Update other examples to use threaded mode for handlers that call disconnect()
This commit is contained in:
parent
ec99339140
commit
24234bf718
5 changed files with 6 additions and 6 deletions
|
@ -62,7 +62,7 @@ class Disco(sleekxmpp.ClientXMPP):
|
||||||
# and the XML streams are ready for use. We want to
|
# and the XML streams are ready for use. We want to
|
||||||
# listen for this event so that we we can initialize
|
# listen for this event so that we we can initialize
|
||||||
# our roster.
|
# our roster.
|
||||||
self.add_event_handler("session_start", self.start)
|
self.add_event_handler("session_start", self.start, threaded=True)
|
||||||
|
|
||||||
def start(self, event):
|
def start(self, event):
|
||||||
"""
|
"""
|
||||||
|
|
|
@ -45,7 +45,7 @@ class PingTest(sleekxmpp.ClientXMPP):
|
||||||
# and the XML streams are ready for use. We want to
|
# and the XML streams are ready for use. We want to
|
||||||
# listen for this event so that we we can initialize
|
# listen for this event so that we we can initialize
|
||||||
# our roster.
|
# our roster.
|
||||||
self.add_event_handler("session_start", self.start)
|
self.add_event_handler("session_start", self.start, threaded=True)
|
||||||
|
|
||||||
def start(self, event):
|
def start(self, event):
|
||||||
"""
|
"""
|
||||||
|
|
|
@ -37,7 +37,7 @@ class PubsubClient(sleekxmpp.ClientXMPP):
|
||||||
self.data = data
|
self.data = data
|
||||||
self.pubsub_server = server
|
self.pubsub_server = server
|
||||||
|
|
||||||
self.add_event_handler('session_start', self.start)
|
self.add_event_handler('session_start', self.start, threaded=True)
|
||||||
|
|
||||||
def start(self, event):
|
def start(self, event):
|
||||||
self.get_roster()
|
self.get_roster()
|
||||||
|
|
|
@ -47,7 +47,7 @@ class RegisterBot(sleekxmpp.ClientXMPP):
|
||||||
# and the XML streams are ready for use. We want to
|
# and the XML streams are ready for use. We want to
|
||||||
# listen for this event so that we we can initialize
|
# listen for this event so that we we can initialize
|
||||||
# our roster.
|
# our roster.
|
||||||
self.add_event_handler("session_start", self.start)
|
self.add_event_handler("session_start", self.start, threaded=True)
|
||||||
|
|
||||||
# The register event provides an Iq result stanza with
|
# The register event provides an Iq result stanza with
|
||||||
# a registration form from the server. This may include
|
# a registration form from the server. This may include
|
||||||
|
@ -56,7 +56,7 @@ class RegisterBot(sleekxmpp.ClientXMPP):
|
||||||
# cases, you will need to examine the fields provided
|
# cases, you will need to examine the fields provided
|
||||||
# and respond accordingly. SleekXMPP provides plugins
|
# and respond accordingly. SleekXMPP provides plugins
|
||||||
# for data forms and OOB links that will make that easier.
|
# for data forms and OOB links that will make that easier.
|
||||||
self.add_event_handler("register", self.register)
|
self.add_event_handler("register", self.register, threaded=True)
|
||||||
|
|
||||||
def start(self, event):
|
def start(self, event):
|
||||||
"""
|
"""
|
||||||
|
|
|
@ -24,7 +24,7 @@ class LocationBot(ClientXMPP):
|
||||||
def __init__(self, jid, password):
|
def __init__(self, jid, password):
|
||||||
super(LocationBot, self).__init__(jid, password)
|
super(LocationBot, self).__init__(jid, password)
|
||||||
|
|
||||||
self.add_event_handler('session_start', self.start)
|
self.add_event_handler('session_start', self.start, threaded=True)
|
||||||
self.add_event_handler('user_location_publish',
|
self.add_event_handler('user_location_publish',
|
||||||
self.user_location_publish)
|
self.user_location_publish)
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue