Package dev.restate.sdk.core
Class SyscallsImpl
java.lang.Object
dev.restate.sdk.core.SyscallsImpl
- All Implemented Interfaces:
Syscalls
-
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) void
close()
createAllDeferred
(List<Deferred<?>> children) createAnyDeferred
(List<Deferred<?>> children) void
enterSideEffectBlock
(String name, EnterSideEffectSyscallCallback callback) void
exitSideEffectBlock
(ByteBuffer toWrite, ExitSideEffectSyscallCallback callback) void
exitSideEffectBlockWithException
(Throwable runException, @Nullable RetryPolicy retryPolicy, ExitSideEffectSyscallCallback callback) void
exitSideEffectBlockWithTerminalException
(TerminalException toWrite, ExitSideEffectSyscallCallback callback) 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 serializedId, String reason, SyscallCallback<Void> callback) void
rejectPromise
(String key, String reason, SyscallCallback<Deferred<Void>> callback) request()
void
resolveAwakeable
(String serializedId, ByteBuffer payload, SyscallCallback<Void> callback) <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> callback) void
set
(String name, ByteBuffer value, SyscallCallback<Void> callback) void
sleep
(Duration duration, SyscallCallback<Deferred<Void>> callback) void
writeOutput
(TerminalException throwable, SyscallCallback<Void> callback) void
writeOutput
(ByteBuffer value, SyscallCallback<Void> callback)
-
Method Details
-
objectKey
-
request
-
writeOutput
- Specified by:
writeOutput
in interfaceSyscalls
-
writeOutput
- Specified by:
writeOutput
in interfaceSyscalls
-
get
-
getKeys
-
clear
-
clearAll
-
set
-
sleep
-
call
public void call(Target target, ByteBuffer parameter, SyscallCallback<Deferred<ByteBuffer>> callback) -
send
public void send(Target target, ByteBuffer parameter, @Nullable Duration delay, SyscallCallback<Void> callback) -
enterSideEffectBlock
- Specified by:
enterSideEffectBlock
in interfaceSyscalls
-
exitSideEffectBlock
- Specified by:
exitSideEffectBlock
in interfaceSyscalls
-
exitSideEffectBlockWithTerminalException
public void exitSideEffectBlockWithTerminalException(TerminalException toWrite, ExitSideEffectSyscallCallback callback) - Specified by:
exitSideEffectBlockWithTerminalException
in interfaceSyscalls
-
exitSideEffectBlockWithException
public void exitSideEffectBlockWithException(Throwable runException, @Nullable RetryPolicy retryPolicy, ExitSideEffectSyscallCallback callback) - Specified by:
exitSideEffectBlockWithException
in interfaceSyscalls
-
awakeable
-
resolveAwakeable
public void resolveAwakeable(String serializedId, ByteBuffer payload, SyscallCallback<Void> callback) - Specified by:
resolveAwakeable
in interfaceSyscalls
-
rejectAwakeable
- Specified by:
rejectAwakeable
in interfaceSyscalls
-
promise
-
peekPromise
- Specified by:
peekPromise
in interfaceSyscalls
-
resolvePromise
public void resolvePromise(String key, ByteBuffer payload, SyscallCallback<Deferred<Void>> callback) - Specified by:
resolvePromise
in interfaceSyscalls
-
rejectPromise
- Specified by:
rejectPromise
in interfaceSyscalls
-
resolveDeferred
- Specified by:
resolveDeferred
in interfaceSyscalls
-
getFullyQualifiedMethodName
-
getInvocationState
-
isInsideSideEffect
public boolean isInsideSideEffect()- Specified by:
isInsideSideEffect
in interfaceSyscalls
- Returns:
- true if it's inside a side effect block.
-
close
public void close() -
fail
-
createAnyDeferred
- Specified by:
createAnyDeferred
in interfaceSyscalls
-
createAllDeferred
- Specified by:
createAllDeferred
in interfaceSyscalls
-