This module provides StreamMap, a container that maps keys to async streams.
It allows for dynamic management of multiple named streams with async operations.
This is an existential wrapper for AsyncStream that is used for the .ofArray function
with CoeDep so it's easier and we keep StreamMap on Type 0.
- mk {α t : Type} [Internal.Async.IO.AsyncStream t α] : t → AnyAsyncStream α
Instances For
Equations
A container that maps keys to async streams, enabling dynamic stream management and unified selection operations across multiple named data sources.
Instances For
Create an empty StreamMap
Instances For
Register a new async stream with the given name
Equations
- One or more equations did not get rendered due to their size.
Instances For
Create a StreamMap from an array of named streams
Equations
- One or more equations did not get rendered due to their size.
Instances For
Get a combined selector that returns the stream name and value
Equations
- One or more equations did not get rendered due to their size.
Instances For
Wait for the first value inside of the stream map.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Wait for the first value inside of the stream map.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Check if a stream with the given name exists
Equations
Instances For
Get the number of registered streams
Equations
- sm.size = (Std.StreamMap.streams✝ sm).size
Instances For
Check if the StreamMap is empty
Equations
- sm.isEmpty = (Std.StreamMap.streams✝ sm).isEmpty
Instances For
Get all registered stream names
Equations
- sm.keys = Array.map (fun (x : α × Std.Internal.IO.Async.Selector β × IO Unit) => x.fst) (Std.StreamMap.streams✝ sm)
Instances For
Get a specific stream selector by name
Equations
- One or more equations did not get rendered due to their size.
Instances For
Convert to array of name-selector pairs
Equations
Instances For
Cleanup function
Equations
- sm.close = Array.forM (fun (x : α × Std.Internal.IO.Async.Selector β × IO Unit) => match x with | (fst, fst_1, cleanup) => cleanup) (Std.StreamMap.streams✝ sm)