Legatus.Canalis.Ws.Memento (legatus v0.2.0)

Copy Markdown View Source

Canalis.Ws.Memento est memoria localis pendentiarum canalis.

This module governs pending downlink items and waiting receiver state inside the WS channel process.

It preserves ordering and continuity between asynchronous arrival and demand.

Summary

Functions

Takes first pending message or returns :empty.

Marks caller as waiting for next message.

Initializes empty pending queue.

Adds message to pending queue or replies immediately to waiting caller.

Replies error to waiting caller (if present) and clears waiting.

Functions

capere(state)

Takes first pending message or returns :empty.

exspectare(from, state)

Marks caller as waiting for next message.

initiare(state)

Initializes empty pending queue.

ponere(msg, state)

Adds message to pending queue or replies immediately to waiting caller.

vitiare(state, reason)

Replies error to waiting caller (if present) and clears waiting.