Ctx
Kind: class
Source: src/graphrefly/_facade.py:453
Signature
Section titled “Signature”Ctx(ctx: _k.Ctx, graph: Graph)Description
Section titled “Description”What an advanced node callback receives for one invocation.
deps reads the invocation’s inputs, state keeps the lifetime’s private
state, and :meth:emit and :meth:down send output. It never sends anything
upstream.
Attributes
Section titled “Attributes”| Name | Type | Description |
|---|---|---|
deps | tuple[Dep, ...] | Return this invocation’s dependency views during setup or function execution. Reads through this ctx or its saved views are refused after this invocation returns, including while a later invocation of the same node runs. |
has_state | bool | Return whether this lifetime’s private state is set (to anything but None). |
state | `object | None` |
signal | _k.Signal | Return the lifetime’s abort signal, aborted when this lifetime closes. |
Methods
Section titled “Methods”emit(*values: object) -> NoneSend one array of DATA, one message per value.
Source: src/graphrefly/_facade.py:483
down(array: Sequence[Message[Any]]) -> NoneSend one array, a list of messages: (DATA, v), (ERROR, e),
(INVALIDATE,) or (COMPLETE,).
START, PENDING and RESOLVED are the kernel’s alone and are rejected, as is a terminal that is not last; the kernel checks the array before anything is sent.
Source: src/graphrefly/_facade.py:495
rewire
Section titled “rewire”rewire(deps: Iterable[Node[Any]]) -> NoneChange this node’s own dependencies for its current lifetime.
It runs after the current wave and is undone when the lifetime closes.
Source: src/graphrefly/_facade.py:540