SessionStorage

interface SessionStorage

Represents a way to write, read and invalidate session bits.

Functions

invalidate

abstract suspend fun invalidate(id: String): Unit

Invalidates session id.

read

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

Reads session id using a consumer as R

write

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

Writes a session id using a specific provider.

Inheritors

CacheStorage

class CacheStorage : SessionStorage

SessionStorageMemory

class SessionStorageMemory : SessionStorage

SessionStorage that stores session contents into memory.