Skip to content

Runtime API

Top-level entry points for initializing the shared executor and lifecycle.

nectar

Nectar SDK top-level package.

add_node

add_node(node: Node) -> None

Register a node with the active executor.

get_executor

get_executor() -> Executor

Return the active executor, lazily initializing if needed.

init

init(num_threads: Optional[int] = None) -> Executor

Initialize the SDK runtime. Returns the shared executor.

remove_node

remove_node(node: Node) -> None

Unregister a node from the active executor.

shutdown

shutdown() -> None

Tear down all registered nodes and stop the SDK-owned executor.

spin

spin() -> None

Block the calling thread until SIGINT; callbacks keep firing in the background.

use_executor

use_executor(executor: Executor) -> None

Use an externally managed executor; the caller spins it.