rsudp.p_producer
(data producer)
- class rsudp.p_producer.Producer(queue, threads, testing=False)
Data Producer thread (see Producer-consumer message passing) which receives data from the port and puts it on the queue to be passed to the master consumer (
rsudp.c_consumer.Consumer
). The producer also looks for flags in each consumer that indicate whether they arealive==False
. If so, the Producer will quit gracefully and put a TERM message on the queue, which should stop all running consumers.- Parameters:
queue (queue.Queue) – The master queue, used to pass data to
rsudp.c_consumer.Consumer
threads (list) – The list of
threading.Thread
s to monitor for status changes
- run()
Distributes queue objects to execute various other tasks: for example, it may be used to populate ObsPy streams for various things like plotting, alert triggers, and ground motion calculation.