Client
Client is a synchronous lifecycle API with mutually exclusive iterator and callback delivery modes. It does not create or expose an asyncio event loop.
pynetft.Client
class Client;Member functions
Client
__init__(config: Config, queue_size: int = 1, callback: Callable[[Sample], None] | None = None) -> None;| Parameter | Type | Default |
|---|---|---|
config | Config | Required |
queue_size | int | 1 |
callback | Callable[[Sample], None] | None | None |
Returns: None
start
start(callback: Callable[[Sample], None] | None = None) -> None;| Parameter | Type | Default |
|---|---|---|
callback | Callable[[Sample], None] | None | None |
Returns: None
stop
stop() -> None;Returns: None
bias
bias() -> None;Returns: None
wait_for_first_sample
wait_for_first_sample(timeout: float) -> bool;| Parameter | Type | Default |
|---|---|---|
timeout | float | Required |
Returns: bool
samples
samples(timeout: float | None = None) -> Iterator[Sample];| Parameter | Type | Default |
|---|---|---|
timeout | float | None | None |
Returns: Iterator[Sample]
latest_sample
latest_sample() -> Sample | None;Returns: Sample | None
health
health() -> Health;Returns: Health
wait
wait(timeout: float | None = None) -> None;| Parameter | Type | Default |
|---|---|---|
timeout | float | None | None |
Returns: None
raise_if_failed
raise_if_failed() -> None;Returns: None
Method behavior
| Method | Contract |
|---|---|
start(callback=None) | Starts iterator or callback delivery. Repeating the same active mode is idempotent; changing mode or callback during a run raises RuntimeError. |
stop() | Idempotently stops native acquisition, closes the delivery queue, wakes readers, and joins an external callback dispatcher. |
samples(timeout=None) | Returns the blocking iterator. Per-read timeout raises TimeoutError; normal stop ends iteration; a terminal sensor fault raises SensorFaultError. |
wait(timeout=None) | Callback-mode completion wait. A wait timeout does not stop acquisition. |
raise_if_failed() | Raises a stored callback-mode delivery failure without waiting. |
latest_sample() | Returns the newest delivered sample without consuming the queue. |
health() | Returns an immutable snapshot including Python queue drops. |
bias() | Sends software bias and requires a running connection. |
Callbacks run serially on a Python dispatcher, not on the native receive worker. When its bounded queue is full, pyNetFT discards the oldest pending Python delivery and increments python_queue_dropped_count.