Interface SharedWorkflowContext
- All Superinterfaces:
Context, SharedObjectContext
- All Known Subinterfaces:
WorkflowContext
- All Known Implementing Classes:
FakeContext
@Deprecated(since="2.9",
forRemoval=true)
public interface SharedWorkflowContext
extends SharedObjectContext
Deprecated, for removal: This API element is subject to removal in a future version.
This interface can be used only within shared handlers of workflow. It extends
Context
adding access to the workflow instance key-value state storage and to the DurablePromise
API.
NOTE: This interface MUST NOT be accessed concurrently since it can lead to different orderings of user actions, corrupting the execution of the invocation.
- See Also:
-
Method Summary
Modifier and TypeMethodDescription<T> DurablePromise<T> promise(DurablePromiseKey<T> key) Deprecated, for removal: This API element is subject to removal in a future version.Create aDurablePromisefor the given key.<T> DurablePromiseHandle<T> promiseHandle(DurablePromiseKey<T> key) Deprecated, for removal: This API element is subject to removal in a future version.Create a newDurablePromiseHandlefor the provided key.Methods inherited from interface Context
awakeable, awakeable, awakeableHandle, call, instantNow, invocationHandle, invocationHandle, invocationHandle, random, request, run, run, run, run, run, run, run, run, run, runAsync, runAsync, runAsync, runAsync, runAsync, runAsync, runAsync, runAsync, runAsync, send, send, signal, signal, sleep, timer, timerMethods inherited from interface SharedObjectContext
get, key, stateKeys
-
Method Details
-
promise
Deprecated, for removal: This API element is subject to removal in a future version.Create aDurablePromisefor the given key.You can use this feature to implement interaction between different workflow handlers, e.g. to send a signal from a shared handler to the workflow handler.
- Returns:
- the
DurablePromise. - See Also:
-
promiseHandle
Deprecated, for removal: This API element is subject to removal in a future version.Create a newDurablePromiseHandlefor the provided key. You can use it toDurablePromiseHandle.resolve(Object)orDurablePromiseHandle.reject(String)the givenDurablePromise.- See Also:
-
Context-parameter programming model is superseded by the reflection-based API. Rather than accepting aSharedWorkflowContextparameter, useRestate.promise(...),Restate.promiseHandle(...)andRestate.state()inside the handler. See the migration guide.