nee-ctx-web-ktor / dev.neeffect.nee.ctx.web / WebContext

WebContext

data class WebContext<R, G : TxProvider<R, G>> : TxProvider<R, WebContext<R, G>>, SecurityProvider<User, UserRole>, ExecutionContextProvider, TraceProvider<WebContext<R, G>>, TimeProvider, Logging, AsyncSupport<WebContext<R, G>>

Constructors

<init>

WebContext(jdbcProvider: TxProvider<R, G>, securityProvider: SecurityProvider<User, UserRole>, executionContextProvider: ExecutionContextProvider, errorHandler: ErrorHandler = DefaultErrorHandler, contextProvider: WebContextProvider<R, G>, traceProvider: TraceProvider<*>, timeProvider: TimeProvider, applicationCall: ApplicationCall, asyncEnv: AsyncEnvWrapper<WebContext<R, G>> = AsyncEnvWrapper())

Functions

getConnection

fun getConnection(): TxConnection<R>

getTrace

fun getTrace(): TraceResource

serveMessage

suspend fun <E, A> serveMessage(msg: Out<E, A>): Unit
suspend fun serveMessage(businessFunction: ANee<WebContext<R, G>, Any>): Unit

serveText

suspend fun serveText(businessFunction: ANee<WebContext<R, G>, String>): Unit

setConnectionState

fun setConnectionState(newState: TxConnection<R>): WebContext<R, G>

setTrace

fun setTrace(newState: TraceResource): WebContext<R, G>