Crate ringmaster_client

Crate ringmaster_client 

Source
Expand description

Client library for a ringmaster_client. THe ring master advertises the RING_MASTER service on the port manager. It accepts several textual requests:

  • CONNECT - connects us, the client to a ring, either as a producer or a consumer.
  • DISCONNECT - disconnects an existing client from a ring.
  • LIST - returns a list of rings and their statistics. this is in the form of a Tcl list and we include a simple list parsing package.
  • REGISTER - registers the creation of a new ringbuffer.
  • UNREGISTER - informs the ring master of a ring destruction.
  • REMOTE - asks the ringmaster to set up a ring2stdout that will then ship data across the connection. This supports obtainng data from remote ringbuffers.

It is intended that this crate be used in conjunction with the nscldaq_ringbuffer package to correctly access rings.

Note: Tests for this 6crate must be run with –test-threads 1 or they will fail. Alternatives will essentially serialize anyway by e.g. entering a mutex when a test starts and then exiting it…so the only point of that would be to make it not necessary for the user to supply – –test-threads 1 to Cargo test.

Structs§

Client
The Client struct and implementation provide the mechanism by means requests are sent to the server and responses an analyzed. With a few exceptions that will be described in the implementation, Each request:
RingBufferConsumer
Provides a consumer that auto registers with the ring. Note that consumers require that a ring already exist to connect.. there’s no create_and_attach method unlike Producers. There is, however, an exception. consumer rings are specified via URLs of the form: tcp://hostname/ringname
RingBufferProducer
A ring buffer producer, needs a continuous connection to the ring master or it will be forced off the ring. This struct packages that with the producer. Creating one of these will make the producer connection if it can and register it with the ring master.
RingInformation
RingInformation provides the information about a ring decoded from the ring master LIST request. Note that we do use nscldaq_ringbuffer::ringbuffer::ConsumerInformation strucs for the consumer data.

Functions§

kill_ring
ring_path
Some methods require the eactual path to the ring. this returns it.