File tree Expand file tree Collapse file tree
engine/sdks/rust/envoy-client/src
rivetkit-typescript/packages
rivetkit/src/drivers/engine Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -135,7 +135,10 @@ impl EnvoyContext {
135135
136136pub async fn start_envoy ( config : EnvoyConfig ) -> EnvoyHandle {
137137 let handle = start_envoy_sync ( config) ;
138- handle. started ( ) . await ;
138+ handle
139+ . started ( )
140+ . await
141+ . expect ( "envoy failed to start before returning handle" ) ;
139142 handle
140143}
141144
Original file line number Diff line number Diff line change @@ -33,8 +33,13 @@ impl EnvoyHandle {
3333 & self . shared . envoy_key
3434 }
3535
36- pub async fn started ( & self ) {
37- let _ = self . started_rx . clone ( ) . changed ( ) . await ;
36+ pub async fn started ( & self ) -> anyhow:: Result < ( ) > {
37+ self . started_rx
38+ . clone ( )
39+ . changed ( )
40+ . await
41+ . map_err ( |_| anyhow:: anyhow!( "envoy stopped before startup completed" ) ) ?;
42+ Ok ( ( ) )
3843 }
3944
4045 pub fn sleep_actor ( & self , actor_id : String , generation : Option < u32 > ) {
@@ -310,7 +315,7 @@ impl EnvoyHandle {
310315 }
311316
312317 // Wait for envoy to be started before injecting
313- self . started ( ) . await ;
318+ self . started ( ) . await ? ;
314319
315320 tracing:: debug!(
316321 data = crate :: stringify:: stringify_to_envoy( & message) ,
Original file line number Diff line number Diff line change @@ -55,6 +55,7 @@ impl JsEnvoyHandle {
5555 self . runtime
5656 . spawn ( async move { handle. started ( ) . await } )
5757 . await
58+ . map_err ( |e| napi:: Error :: from_reason ( e. to_string ( ) ) ) ?
5859 . map_err ( |e| napi:: Error :: from_reason ( e. to_string ( ) ) )
5960 }
6061
Original file line number Diff line number Diff line change @@ -186,6 +186,7 @@ export class EngineActorDriver implements ActorDriver {
186186 token : config . token ,
187187 namespace : config . namespace ,
188188 poolName : config . envoy . poolName ,
189+ notGlobal : true ,
189190 metadata : {
190191 rivetkit : { version : VERSION } ,
191192 } ,
@@ -212,9 +213,14 @@ export class EngineActorDriver implements ActorDriver {
212213
213214 this . #envoy = envoy ;
214215
215- envoy . started ( ) . then ( ( ) => {
216- this . #envoyStarted. resolve ( ) ;
217- } ) ;
216+ envoy . started ( ) . then (
217+ ( ) => {
218+ this . #envoyStarted. resolve ( ) ;
219+ } ,
220+ ( error ) => {
221+ this . #envoyStarted. reject ( error ) ;
222+ } ,
223+ ) ;
218224
219225 logger ( ) . debug ( {
220226 msg : "envoy client started" ,
You can’t perform that action at this time.
0 commit comments