juturna.transport package¶
Module contents¶
- class juturna.transport.Condition(*args, **kwargs)¶
Bases:
ProtocolA lock with wait/notify semantics, used to track pending work.
- notify_all() None¶
- wait_for(predicate: Callable[[], bool], timeout: float | None = None) None¶
- exception juturna.transport.Empty¶
Bases:
ExceptionRaised by Queue.get() when no item is available within the timeout.
- class juturna.transport.Lock(*args, **kwargs)¶
Bases:
ProtocolA mutual exclusion primitive, used as a context manager.
- class juturna.transport.Queue(*args, **kwargs)¶
Bases:
ProtocolA FIFO channel used to move messages between nodes and workers.
- empty() bool¶
- full() bool¶
- get(timeout: float | None = None) Any¶
- get_nowait() Any¶
- put(item: Any, timeout: float | None = None) None¶
- qsize() int¶
- class juturna.transport.Signal(*args, **kwargs)¶
Bases:
ProtocolA boolean flag shared across workers, used to signal stop conditions.
- clear() None¶
- is_set() bool¶
- set() None¶
- wait(timeout: float | None = None) bool¶
- class juturna.transport.ThreadingTransport¶
Bases:
objectDefault transport backend, based on real OS threads.
This backend preserves the current concurrency model of Node and Buffer: every worker runs on its own threading.Thread, and queues are backed by queue.Queue.
- is_current(handle: WorkerHandle) bool¶
- new_condition() _ThreadCondition¶
- new_lock() _ThreadLock¶
- new_queue(maxsize: int = 0) _ThreadQueue¶
- new_signal() _ThreadSignal¶
- spawn(target: Callable[[], None], name: str, daemon: bool = True) _ThreadWorker¶
- class juturna.transport.TransportBackend(*args, **kwargs)¶
Bases:
ProtocolFactory of concurrency primitives used by nodes and buffers.
An implementation decides how messages are moved and how workers are executed (e.g. real OS threads, or a cooperative scheduler); nodes and buffers only depend on this interface, never on the concrete primitives.
- is_current(handle: WorkerHandle) bool¶
- spawn(target: Callable[[], None], name: str, daemon: bool = True) WorkerHandle¶
- class juturna.transport.WorkerHandle(*args, **kwargs)¶
Bases:
ProtocolA handle to a unit of concurrent execution spawned by a backend.
- is_alive() bool¶
- join(timeout: float | None = None) None¶
- start() None¶
- juturna.transport.get_transport(name: str | None = None) TransportBackend¶
Resolve a transport backend by name.
- Parameters:
name (str | None) – The name of the transport backend, as registered in _TRANSPORTS. Defaults to the threading backend if not provided.
- Returns:
A new instance of the requested backend.
- Return type:
- Raises:
ValueError – If name does not match any registered backend.