Package com.trib3.server.coroutine

Types

Link copied to clipboard
annotation class AsyncDispatcher(val dispatcher: String)

Annotation that allows explicitly setting the dispatcher for coroutine async jersey resource methods. dispatcher can be any of: "Default", "IO", "Unconfined" ("Main" supported if a main dispatcher artifact is imported, but generally doesn't apply to a server)

Link copied to clipboard
class CoroutineInvocationHandler(    val asyncContextProvider: Provider<AsyncContext>,     val originalObjectProvider: () -> Any,     val originalInvocable: Invocable,     val shouldIgnoreReturn: Boolean) : InvocationHandler, CoroutineScope

InvocationHandler that runs a jersey resource method implemented by a suspend function in a coroutine, and bridges the return/exception value into an AsyncContext for the request, allowing suspend functions to transparently implement jersey async requests.

Link copied to clipboard
@Provider
class CoroutineModelProcessor @Inject constructor(val injectionManager: InjectionManager, val asyncContextProvider: Provider<AsyncContext>) : ModelProcessor

Jersey ModelProcessor that finds resource methods that are implemented with a suspend function, and redefines them with a dynamically created non-suspend function. That dynamically created implementation will then use the CoroutineInvocationHandler to invoke the suspend function.