Filter - Scauting-Burgum/ScautNet-python GitHub Wiki
The Filter
-class is used inside a pipeline in converting data.
Methods
Filter.kill
This method can be used to stop the filter's threads.
Filter.start
This method starts the filter's threads.
Filter.push
This method puts data into sending_thread.queue
Arguments
data
; the data to be pushed.
Filter.pull
This method gets data from receiving_thread.queue
Arguments
timeout
; Once this timeout expires,queue.Empty
will be raised. (Defaults to 1 second)
Raises
queue.Empty
; When no data can be pulled before the timeout's elapsed.
Properties
Filter.alive
Returns True
if the filter's threads are alive and Filter.kill
hasn't been called,
otherwise returns False
.
Filter.receiving_thread
The thread that processes data coming from the connection.
Requirements
- A start method;
receiving_thread.start()
- A life-checking method;
receiving_thread.is_alive()
- A queue;
receiving_thread.queue
Filter.sending_thread
The thread that processes data going to the connection.
Requirements
- A start method;
sending_thread.start()
- A life-checking method;
sending_thread.is_alive()
- A queue;
sending_thread.queue