1- package obelisk : workflow @ 2 .0.0;
1+ package obelisk : workflow @ 3 .0.0;
22
3+ @since (version = 3.0.0 )
34interface workflow-support {
4- use obelisk :types /time @ 2 .0.0. {schedule-at };
5- use obelisk :types /execution @ 2 .0.0. {join-set-id , delay-id , execution-id , response-id };
5+ use obelisk :types /time @ 3 .0.0. {schedule-at , datetime };
6+ use obelisk :types /execution @ 3 .0.0. {join-set , delay-id , execution-id , response-id };
67
78 /// The closing strategy of a join set. Join sets are closed when execution finishes.
9+ @since (version = 3.0.0 )
810 enum closing-strategy {
911 /// All submitted child execution requests that were not awaited by the workflow are awaited during join set close.
1012 /// Delay requests are not awaited.
@@ -14,42 +16,60 @@ interface workflow-support {
1416 // TODO: Implement cancel
1517 }
1618
19+ /// Error variants that may occur on named join set creation.
20+ @since (version = 3.0.0 )
1721 variant join-set-create-error {
1822 conflict ,
1923 invalid-name (string ),
2024 }
2125
22-
2326 /// Returns a random u64 in the range [min, max).
27+ @since (version = 3.0.0 )
2428 random-u64 : func (min : u64 , max-exclusive : u64 ) -> u64 ;
2529 /// Returns a random u64 in the range [min, max].
30+ @since (version = 3.0.0 )
2631 random-u64-inclusive : func (min : u64 , max-inclusive : u64 ) -> u64 ;
2732
2833 /// Returns a random string with a length in the range [min_length, max_length).
2934 /// The string consists only of alphanumeric characters (lowercase and uppercase letters, digits).
35+ @since (version = 3.0.0 )
3036 random-string : func (min-length : u16 , max-length-exclusive : u16 ) -> string ;
3137
32- /// Block execution for given time.
33- sleep : func (schedule-at : schedule-at );
38+ /// Block execution for given time, return `schedule-at` resolved to time when the execution is scheduled.
39+ @since (version = 3.0.0 )
40+ sleep : func (schedule-at : schedule-at ) -> datetime ;
3441
3542 /// Submit a delay request to the join set. The delay can be later polled using `join-next` .
36- submit-delay : func (join-set-id : borrow <join-set-id >, timeout : schedule-at ) -> delay-id ;
43+ @since (version = 3.0.0 )
44+ submit-delay : func (join-set : borrow <join-set >, timeout : schedule-at ) -> delay-id ;
3745
3846 /// Create a new completing join set.
39- new-join-set-named : func (name : string , closing-strategy : closing-strategy ) -> result <join-set-id , join-set-create-error >;
47+ @since (version = 3.0.0 )
48+ new-join-set-named : func (name : string , closing-strategy : closing-strategy ) -> result <join-set , join-set-create-error >;
4049
4150 /// Create a new completing join set with a generated name.
42- new-join-set-generated : func (closing-strategy : closing-strategy ) -> join-set-id ;
51+ @since (version = 3.0.0 )
52+ new-join-set-generated : func (closing-strategy : closing-strategy ) -> join-set ;
4353
54+ /// Error variants that may occur when calling `join-next` function.
55+ @since (version = 3.0.0 )
4456 variant join-next-error {
4557 /// All submitted requests and their responses were already processed.
4658 all-processed ,
4759 }
60+
61+ /// Explicitly close join set. All executions that were submitted and not awaited,
62+ /// in other words executions with unprocessed responses, will be either
63+ /// awaited or cancelled based on `closing-strategy` .
64+ /// Extension function `-get` can be used to lookup the execution result.
65+ @since (version = 3.0.0 )
66+ close : func (join-set : join-set );
67+
4868 /// Block the workflow execution until next response associated with the join set arrives.
4969 /// The response is marked as processed.
5070 /// Child execution result can be obtained using `-get` extension function using the
5171 /// returned execution ID.
52- /// Return `none ` if the join set has all requests matched with responses.
53- join-next : func ( join-set-id : borrow < join-set-id >) ->
54- result<response-id, join-next-error>;
72+ /// Return `join-next-error::all-processed ` if the join set has all requests matched with responses.
73+ @since ( version = 3.0.0 )
74+ join-next : func ( join-set : borrow < join-set >) -> result <response-id , join-next-error >;
5575}
0 commit comments