On 15/07/2020 5:21 pm, Francesco Raviglione wrote:
I've seen that several examples are sending data which was available/defined before the AMQP event loop is started. However, I need to send data only when it becomes available from an external process (for example by waiting for it on a Pipe, with self.amqp_pipe_end.recv()), and then send it immediately to the broker. If I try to wait on a pipe inside "on_sendable", no message is actually transferred to the broker, as the event loop is "blocked" waiting for new data and cannot manage properly the AMQP 1.0 connection (is this correct?). How could I achieve the desired result? How can I make the loop wait for external data and then immediately send it?
Have you looked at the https://github.com/apache/qpid-proton/blob/master/python/examples/db_send.py example? It uses a separate thread to read records from a database when they are inserted and then triggers an event on the proton event thread to send those messages out.
--------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
