ReconServer

Contents

ReconServer#

class pulserver.proxy.ReconServer[source]#

Bases: object

Reconstructs each series of an MRD stream as it is received.

The server a ReconProxy forwards to: one thread per client connection, which carries one series, a config naming its reconstruction plugin, the header, the acquisitions and a CLOSE. The config is a config file message, whose name is the plugin, or a config text naming it as a bare name or under parameters.config. Nothing is enriched. Workers, slots, the queue and the exam directories are those of ReconProxy.

Parameters:
  • plugins – Directories of reconstruction plugin files, <plugin>.py, in search order.

  • slots – Series reconstructed at once; derived from memory and the GPUs when None.

  • gpu_slots – Series reconstructed at once on each GPU, when slots is None.

  • spares – Warm worker processes waiting for a series.

  • recon_timeout – Seconds a worker may take after the stream ends before it is terminated and the client told so; None waits for its close.

  • queue – Directory the queued series are written to; a temporary directory, removed on close(), when None.

  • slot_directory – Directory the slots are held in, shared with every other proxy on this host so they count against one set; DEFAULT_SLOT_DIRECTORY when None.

  • exam_directory – Directory the caches of an exam are held in, shared with every other proxy on this host so a map one series measures reaches a series on another; DEFAULT_EXAM_DIRECTORY when None. An exam’s directory is removed when the last proxy on that exam lets go of it.

Attributes:
  • workers (WorkerPool) – The spares assignments are taken from.

  • exams (ExamCacheManager) – The current exam and its directory.

  • queue (Path) – The queue directory.

Methods

bind

Listen on port and return the port bound; 0 takes a free one.

close

Stop accepting clients, wait for running series and release the spares.

serve

Accept clients until stop(), close(), or nothing comes.

stop

Make serve() return within one accept poll.

Attributes

port

Port the server listens on.