@@ -8,7 +8,7 @@ use std::time::Duration;
88
99mod request;
1010mod run;
11- pub use request:: { Request , RequestTarget } ;
11+ pub use request:: { CallFuture , InvocationHandle , Request , RequestTarget } ;
1212pub use run:: { RunClosure , RunFuture , RunRetryPolicy } ;
1313
1414pub type HeaderMap = http:: HeaderMap < String > ;
@@ -370,20 +370,20 @@ impl<'ctx, CTX: private::SealedContext<'ctx>> ContextTimers<'ctx> for CTX {}
370370/// // To a Service:
371371/// ctx.service_client::<MyServiceClient>()
372372/// .my_handler(String::from("Hi!"))
373- /// .send_with_delay (Duration::from_millis(5000));
373+ /// .send_after (Duration::from_millis(5000));
374374///
375375/// // To a Virtual Object:
376376/// ctx.object_client::<MyVirtualObjectClient>("Mary")
377377/// .my_handler(String::from("Hi!"))
378- /// .send_with_delay (Duration::from_millis(5000));
378+ /// .send_after (Duration::from_millis(5000));
379379///
380380/// // To a Workflow:
381381/// ctx.workflow_client::<MyWorkflowClient>("my-workflow-id")
382382/// .run(String::from("Hi!"))
383- /// .send_with_delay (Duration::from_millis(5000));
383+ /// .send_after (Duration::from_millis(5000));
384384/// ctx.workflow_client::<MyWorkflowClient>("my-workflow-id")
385385/// .interact_with_workflow()
386- /// .send_with_delay (Duration::from_millis(5000));
386+ /// .send_after (Duration::from_millis(5000));
387387/// # Ok(())
388388/// # }
389389/// ```
@@ -433,6 +433,11 @@ pub trait ContextClient<'ctx>: private::SealedContext<'ctx> {
433433 Request :: new ( self . inner_context ( ) , request_target, req)
434434 }
435435
436+ /// Create an [`InvocationHandle`] from an invocation id.
437+ fn invocation_handle ( & self , invocation_id : String ) -> impl InvocationHandle + ' ctx {
438+ self . inner_context ( ) . invocation_handle ( invocation_id)
439+ }
440+
436441 /// Create a service client. The service client is generated by the [`restate_sdk_macros::service`] macro with the same name of the trait suffixed with `Client`.
437442 ///
438443 /// ```rust,no_run
@@ -454,7 +459,7 @@ pub trait ContextClient<'ctx>: private::SealedContext<'ctx> {
454459 /// client.handle().send();
455460 ///
456461 /// // Schedule the request to be executed later
457- /// client.handle().send_with_delay (Duration::from_secs(60));
462+ /// client.handle().send_after (Duration::from_secs(60));
458463 /// # }
459464 /// ```
460465 fn service_client < C > ( & self ) -> C
@@ -485,7 +490,7 @@ pub trait ContextClient<'ctx>: private::SealedContext<'ctx> {
485490 /// client.handle().send();
486491 ///
487492 /// // Schedule the request to be executed later
488- /// client.handle().send_with_delay (Duration::from_secs(60));
493+ /// client.handle().send_after (Duration::from_secs(60));
489494 /// # }
490495 /// ```
491496 fn object_client < C > ( & self , key : impl Into < String > ) -> C
@@ -516,7 +521,7 @@ pub trait ContextClient<'ctx>: private::SealedContext<'ctx> {
516521 /// client.handle().send();
517522 ///
518523 /// // Schedule the request to be executed later
519- /// client.handle().send_with_delay (Duration::from_secs(60));
524+ /// client.handle().send_after (Duration::from_secs(60));
520525 /// # }
521526 /// ```
522527 fn workflow_client < C > ( & self , key : impl Into < String > ) -> C
@@ -627,7 +632,7 @@ pub trait ContextAwakeables<'ctx>: private::SealedContext<'ctx> {
627632 & self ,
628633 ) -> (
629634 String ,
630- impl Future < Output = Result < T , TerminalError > > + Send + Sync + ' ctx ,
635+ impl Future < Output = Result < T , TerminalError > > + Send + ' ctx ,
631636 ) {
632637 self . inner_context ( ) . awakeable ( )
633638 }
0 commit comments