@@ -6,8 +6,12 @@ use crate::serde::{Deserialize, Serialize};
66use std:: future:: Future ;
77use std:: time:: Duration ;
88
9+ #[ doc( hidden) ]
10+ pub mod macro_support;
911mod request;
1012mod run;
13+ mod select;
14+
1115pub use request:: { CallFuture , InvocationHandle , Request , RequestTarget } ;
1216pub use run:: { RunClosure , RunFuture , RunRetryPolicy } ;
1317
@@ -249,7 +253,10 @@ impl<'ctx> WorkflowContext<'ctx> {
249253/// </details>
250254pub trait ContextTimers < ' ctx > : private:: SealedContext < ' ctx > {
251255 /// Sleep using Restate
252- fn sleep ( & self , duration : Duration ) -> impl Future < Output = Result < ( ) , TerminalError > > + ' ctx {
256+ fn sleep (
257+ & self ,
258+ duration : Duration ,
259+ ) -> impl DurableFuture < Output = Result < ( ) , TerminalError > > + ' ctx {
253260 private:: SealedContext :: inner_context ( self ) . sleep ( duration)
254261 }
255262}
@@ -632,7 +639,7 @@ pub trait ContextAwakeables<'ctx>: private::SealedContext<'ctx> {
632639 & self ,
633640 ) -> (
634641 String ,
635- impl Future < Output = Result < T , TerminalError > > + Send + ' ctx ,
642+ impl DurableFuture < Output = Result < T , TerminalError > > + Send + ' ctx ,
636643 ) {
637644 self . inner_context ( ) . awakeable ( )
638645 }
@@ -918,7 +925,7 @@ pub trait ContextPromises<'ctx>: private::SealedContext<'ctx> {
918925 fn promise < T : Deserialize + ' static > (
919926 & ' ctx self ,
920927 key : & str ,
921- ) -> impl Future < Output = Result < T , TerminalError > > + ' ctx {
928+ ) -> impl DurableFuture < Output = Result < T , TerminalError > > + ' ctx {
922929 self . inner_context ( ) . promise ( key)
923930 }
924931
@@ -946,9 +953,10 @@ impl<'ctx, CTX: private::SealedContext<'ctx> + private::SealedCanUsePromises> Co
946953{
947954}
948955
949- mod private {
950- use super :: * ;
956+ pub trait DurableFuture : Future + macro_support:: SealedDurableFuture { }
951957
958+ pub ( crate ) mod private {
959+ use super :: * ;
952960 pub trait SealedContext < ' ctx > {
953961 fn inner_context ( & self ) -> & ' ctx ContextInternal ;
954962
0 commit comments