SessionStorageMemory

class SessionStorageMemory : SessionStorage

SessionStorage that stores session contents into memory.

Since it doesn’t use any TTL sessions, memory usage will increase while the application is running and session information will be discarded once the server stops.

This is intended for development.

Constructors

<init>

SessionStorageMemory()

SessionStorage that stores session contents into memory.

Functions

invalidate

suspend fun invalidate(id: String): Unit

Invalidates session id.

read

suspend fun <R> read(
    id: String,
    consumer: suspend (ByteReadChannel) -> R
): R

Reads session id using a consumer as R

write

suspend fun write(
    id: String,
    provider: suspend (ByteWriteChannel) -> Unit
): Unit

Writes a session id using a specific provider.