katgpucbf.send module

Shared utilities for sending data over SPEAD.

class katgpucbf.send.DescriptorSender(stream: spead2.send.asyncio.AsyncStream, descriptors: Heap, interval: float, first_interval: float | None = None, *, substreams: Iterable[int] = (0,))[source]

Bases: object

Manage sending descriptors at regular intervals.

The descriptors are first sent once immediately, then after first_interval seconds, then every interval seconds. Using a different first_interval makes it possible to stagger different senders so that their descriptors do not all arrive at a common receiver at the same time.

The descriptors are sent with zero rate, which means they will not affect the timing of other packets in the same stream.

Parameters:
  • stream – The stream to which the descriptor will be sent. It will be sent to all substreams simultaneously.

  • descriptors – The descriptor heap to send.

  • interval – Interval (in seconds) between sending descriptors.

  • first_interval – Delay (in seconds) immediately after starting. If not specified, it defaults to interval.

  • substreams – Substream indices to which descriptors are sent. If not specified, send only to the first substream.

halt() None[source]

Request run() to stop, but do not wait for it.

async run() None[source]

Send the descriptors indefinitely (use halt() or cancel to stop).