bluesky_queueserver.ReceiveConsoleOutputAsync.set_callback
- ReceiveConsoleOutputAsync.set_callback(cb)[source]
Set callback function, which is called once for each received message. If
cbis a function, it is called immediately and execution of the loop is blocked until the execution of the function is complete. Ifcbis coroutine, it is not awaited, but instead placed in the loop usingasyncio.ensure_future. Only one callback function can be set.- Parameters:
- cbcallable, coroutine or None
Reference to a callback function or coroutine. The function signature is expected to receive a message as a parameter (message is a dictionary with keys
timeandmsg) and returnNone. The function is expected to handle exceptions that are raised internally. PassNoneto clear callback (messages will be received and discarded).