pymessaging: Add a hook to run the event loop, make callbacks practical
authorAndrew Bartlett <abartlet@samba.org>
Mon, 13 Mar 2017 23:39:13 +0000 (12:39 +1300)
committerAndrew Bartlett <abartlet@samba.org>
Tue, 28 Mar 2017 07:23:11 +0000 (09:23 +0200)
commit8c75d9fc73614fad29a998d08c4b11034ab2aebb
treead874ec971f76b5a412f0ff97bd47071f03ca1d9
parente92a20781ca45b8696397cdef424fe8b92bee66b
pymessaging: Add a hook to run the event loop, make callbacks practical

These change allow us to write a messaging server in python.

The previous ping_speed test did not actually test anything, so
we use .loop_once() to make it actually work.  To enable practial use
a context is supplied in the tuple with the callback, and the server_id
for the reply is not placed inside an additional tuple.

In order to get at the internal event context on which to loop, we
expose imessaging_context in messaging_internal.h and allow the python
bindings to use that header.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
python/samba/tests/messaging.py
source4/lib/messaging/messaging.c
source4/lib/messaging/messaging_internal.h [new file with mode: 0644]
source4/lib/messaging/pymessaging.c