context

@ApiStatus.Experimental
suspend fun context(): Context

Get the current Restate Context from within a handler.

This function must be called from within a Restate handler's suspend function. It retrieves the context from the coroutine context.

Example usage:

@Service
class MyService {
@Handler
suspend fun myHandler(input: String): String {
val ctx = context()
// Use ctx for Restate operations
return "processed: $input"
}
}

Throws

if called outside of a Restate handler