Skip to main content

Module source

Module source 

Source
Expand description

Cold synchronous sources — finite-sequence and terminal-constant producer factories.

These are the handle-protocol analogues of TS extra/sources/iter.ts:

  • from_iter — emit each HandleId as DATA in order, then COMPLETE.
  • of — convenience wrapper: from_iter over a Vec.
  • empty — COMPLETE immediately with no DATA.
  • [never] — silent until teardown (no DATA, no terminal).
  • throw_error — emit ERROR immediately.

All factories register a producer node with no deps. The build closure fires once on first activation (first subscriber) and emits synchronously. Deactivation (last subscriber drops) auto-cleans via the standard producer_deactivate path.

§Handle protocol

Values live on the binding side; Core sees only opaque HandleId. from_iter / of take pre-interned HandleIds — the caller (binding layer) must retain_handle each handle before passing it in (the source retains once more per emission and releases the caller’s share on activation). throw_error takes a pre-interned error handle.

empty and never need no handles — they are pure lifecycle sources.

Functions§

empty
Complete immediately with no DATA (cold EMPTY analogue).
from_iter
Emit each handle as DATA in order, then COMPLETE. If the iterator is empty, behaves like empty (COMPLETE only).
never
Never emit and never complete until teardown (cold NEVER analogue). The build closure is a no-op — the producer stays active but silent until the last subscriber drops.
of
Emit each handle as DATA in order, then COMPLETE. Convenience wrapper over from_iter.
throw_error
Emit ERROR immediately with the given error handle (cold error source).