Package dev.restate.sdk.common.syscalls
Interface Syscalls
- All Known Implementing Classes:
SyscallsImpl
public interface Syscalls
Internal interface to access Restate functionalities. Users can use the ad-hoc RestateContext
interfaces provided by the various implementations.
When using executor switching wrappers, the method's callback
will be executed in the
state machine executor.
-
Method Summary
Modifier and TypeMethodDescriptionvoid
awakeable
(SyscallCallback<Map.Entry<String, Deferred<ByteBuffer>>> callback) void
call
(Target target, ByteBuffer parameter, SyscallCallback<Deferred<ByteBuffer>> callback) void
clear
(String name, SyscallCallback<Void> callback) void
clearAll
(SyscallCallback<Void> callback) createAllDeferred
(List<Deferred<?>> children) createAnyDeferred
(List<Deferred<?>> children) void
enterSideEffectBlock
(@Nullable String name, EnterSideEffectSyscallCallback callback) void
exitSideEffectBlock
(ByteBuffer toWrite, ExitSideEffectSyscallCallback callback) void
exitSideEffectBlockWithException
(Throwable toWrite, @Nullable RetryPolicy retryPolicy, ExitSideEffectSyscallCallback callback) void
exitSideEffectBlockWithTerminalException
(TerminalException toWrite, ExitSideEffectSyscallCallback callback) Deprecated, for removal: This API element is subject to removal in a future version.void
void
get
(String name, SyscallCallback<Deferred<ByteBuffer>> callback) void
getKeys
(SyscallCallback<Deferred<Collection<String>>> callback) boolean
void
peekPromise
(String key, SyscallCallback<Deferred<ByteBuffer>> callback) void
promise
(String key, SyscallCallback<Deferred<ByteBuffer>> callback) void
rejectAwakeable
(String id, String reason, SyscallCallback<Void> requestCallback) void
rejectPromise
(String key, String reason, SyscallCallback<Deferred<Void>> callback) request()
void
resolveAwakeable
(String id, ByteBuffer payload, SyscallCallback<Void> requestCallback) <T> void
resolveDeferred
(Deferred<T> deferredToResolve, SyscallCallback<Void> callback) void
resolvePromise
(String key, ByteBuffer payload, SyscallCallback<Deferred<Void>> callback) void
send
(Target target, ByteBuffer parameter, @Nullable Duration delay, SyscallCallback<Void> requestCallback) void
set
(String name, ByteBuffer value, SyscallCallback<Void> callback) void
sleep
(Duration duration, SyscallCallback<Deferred<Void>> callback) void
writeOutput
(TerminalException exception, SyscallCallback<Void> callback) void
writeOutput
(ByteBuffer value, SyscallCallback<Void> callback)
-
Method Details
-
objectKey
String objectKey() -
request
Request request() -
isInsideSideEffect
boolean isInsideSideEffect()- Returns:
- true if it's inside a side effect block.
-
writeOutput
-
writeOutput
-
get
-
getKeys
-
clear
-
clearAll
-
set
-
sleep
-
call
-
send
void send(Target target, ByteBuffer parameter, @Nullable Duration delay, SyscallCallback<Void> requestCallback) -
enterSideEffectBlock
-
exitSideEffectBlock
-
exitSideEffectBlockWithTerminalException
@Deprecated(since="1.1.0", forRemoval=true) void exitSideEffectBlockWithTerminalException(TerminalException toWrite, ExitSideEffectSyscallCallback callback) Deprecated, for removal: This API element is subject to removal in a future version. -
exitSideEffectBlockWithException
void exitSideEffectBlockWithException(Throwable toWrite, @Nullable RetryPolicy retryPolicy, ExitSideEffectSyscallCallback callback) -
awakeable
-
resolveAwakeable
-
rejectAwakeable
-
promise
-
peekPromise
-
resolvePromise
-
rejectPromise
-
fail
-
resolveDeferred
-
createAnyDeferred
-
createAllDeferred
-
exitSideEffectBlockWithException(Throwable, RetryPolicy, ExitSideEffectSyscallCallback)
instead.