Scoop API

scoop:scoop.http.asyncio:0.1.0

AsyncWebSocketSession

class AsyncWebSocketSession

source · line 11
public
public class AsyncWebSocketSession internal constructor(
    private val state: WsState
) : AsyncCloseable

A structured WebSocket session over an already-upgraded transport. Background tasks handle control frames and bounded message backpressure; serialize message operations in each direction.

function close

source · line 141
public
public override suspend fun close(): Unit

Performs local closure, cancelling owned I/O and waiting for native borrows and cleanup. Repeated close is supported, including cleanup from an already-cancelled caller.

function awaitClosed

source · line 134
public
public suspend fun awaitClosed(): Unit

Waits for session cleanup to complete.

function receive

source · line 89
public
public suspend fun receive(): WebSocketMessage?

Waits for the next message or returns None at normal session end. Complete the current message before requesting another.