diff options
author | Lance Stout <lancestout@gmail.com> | 2010-12-07 17:19:39 -0500 |
---|---|---|
committer | Lance Stout <lancestout@gmail.com> | 2010-12-07 17:19:39 -0500 |
commit | 5f2fc67c40f0cd73bee7b2cf3bc3a73d83832a50 (patch) | |
tree | cff5c77f3685a4eecd907a31226e402ed46cf32c /examples | |
parent | 8ead33fc3bdb75312c3112db5001cf9544566efb (diff) | |
download | slixmpp-5f2fc67c40f0cd73bee7b2cf3bc3a73d83832a50.tar.gz slixmpp-5f2fc67c40f0cd73bee7b2cf3bc3a73d83832a50.tar.bz2 slixmpp-5f2fc67c40f0cd73bee7b2cf3bc3a73d83832a50.tar.xz slixmpp-5f2fc67c40f0cd73bee7b2cf3bc3a73d83832a50.zip |
Added option for iq.send to accept a callhandler.
The callback will be a stream level handler, and will not
execute in its own thread. If you must have a thread, have the
callback function raise a custom event, which can be processed
by another event handler, which may run in an individual thread,
like so:
def handle_reply(self, iq):
self.event('custom_event', iq)
def do_long_operation_in_thread(self, iq):
...
self.add_event_handler('custom_event', self.do_long_operation_in_thread)
...take out already prepared iq stanza...
iq.send(callback=self.handle_reply)
Diffstat (limited to 'examples')
0 files changed, 0 insertions, 0 deletions