You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -168,8 +168,8 @@ export class EngineActorDriver implements ActorDriver {
168
168
rivetkit: {version: VERSION},
169
169
},
170
170
prepopulateActorNames: buildActorNames(config),
171
-
onShutdown: (reason: utils.ShutdownReason)=>{
172
-
this.#envoyStopped.resolve(reason);
171
+
onShutdown: ()=>{
172
+
this.#envoyStopped.resolve();
173
173
this.#isEnvoyStopped =true;
174
174
},
175
175
fetch: this.#envoyFetch.bind(this),
@@ -191,7 +191,7 @@ export class EngineActorDriver implements ActorDriver {
191
191
this.#envoy =envoy;
192
192
193
193
envoy.started().then(()=>{
194
-
this.#envoyStarted.resolve(undefined);
194
+
this.#envoyStarted.resolve();
195
195
});
196
196
197
197
logger().debug({
@@ -514,18 +514,12 @@ export class EngineActorDriver implements ActorDriver {
514
514
// NOTE: onAbort does not work reliably
515
515
stream.onAbort(()=>{});
516
516
c.req.raw.signal.addEventListener("abort",()=>{
517
-
logger().debug("SSE aborted, shutting down runner");
518
-
519
-
// We cannot assume that the request will always be closed gracefully by Rivet. We always proceed with a graceful shutdown in case the request was terminated for any other reason.
520
-
//
521
-
// If we did not use a graceful shutdown, the runner would
522
-
this.shutdown(false);
517
+
logger().debug("SSE aborted");
523
518
});
524
519
525
520
awaitthis.#envoyStarted.promise;
526
521
527
-
// Runner id should be set if the runner started
528
-
this.#envoy.startServerless(payload);
522
+
this.#envoy.startServerlessActor(payload);
529
523
530
524
// Send ping every second to keep the connection alive
531
525
while(true){
@@ -548,12 +542,6 @@ export class EngineActorDriver implements ActorDriver {
548
542
awaitstream.writeSSE({event: "ping",data: ""});
549
543
awaitstream.sleep(ENVOY_SSE_PING_INTERVAL);
550
544
}
551
-
552
-
// Wait for the runner to stop if the SSE stream aborted early for any reason
553
-
letreason=awaitthis.#envoyStopped.promise;
554
-
if(reason==="serverless-early-exit"){
555
-
stream.writeSSE({event: "stopping",data: ""});
556
-
}
557
545
});
558
546
}
559
547
@@ -783,7 +771,7 @@ export class EngineActorDriver implements ActorDriver {
0 commit comments