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 @@ -58,6 +58,7 @@ impl JsEnvoyHandle {
5858 self . runtime
5959 . spawn ( async move { handle. started ( ) . await } )
6060 . await
61+ . map_err ( |e| napi:: Error :: from_reason ( e. to_string ( ) ) ) ?
6162 . map_err ( |e| napi:: Error :: from_reason ( e. to_string ( ) ) )
6263 }
6364
Original file line number Diff line number Diff line change @@ -185,6 +185,7 @@ export class EngineActorDriver implements ActorDriver {
185185 token : config . token ,
186186 namespace : config . namespace ,
187187 poolName : config . envoy . poolName ,
188+ notGlobal : true ,
188189 metadata : {
189190 rivetkit : { version : VERSION } ,
190191 } ,
@@ -211,9 +212,14 @@ export class EngineActorDriver implements ActorDriver {
211212
212213 this . #envoy = envoy ;
213214
214- envoy . started ( ) . then ( ( ) => {
215- this . #envoyStarted. resolve ( ) ;
216- } ) ;
215+ envoy . started ( ) . then (
216+ ( ) => {
217+ this . #envoyStarted. resolve ( ) ;
218+ } ,
219+ ( error ) => {
220+ this . #envoyStarted. reject ( error ) ;
221+ } ,
222+ ) ;
217223
218224 logger ( ) . debug ( {
219225 msg : "envoy client started" ,
You can’t perform that action at this time.
0 commit comments