comparison bot.py @ 47:dd9d93ae405a

Reduce latency. Signed-off-by: Charly COSTE <changaco@changaco.net>
author Charly COSTE <changaco@changaco.net>
date Mon, 24 Aug 2009 22:00:38 +0200
parents d29171ab2df1
children cb08ea878db9
comparison
equal deleted inserted replaced
46:d29171ab2df1 47:dd9d93ae405a
77 if len(self.xmpp_connections) == 1: 77 if len(self.xmpp_connections) == 1:
78 sleep(0.5) # avoid bot connection being locked all the time 78 sleep(0.5) # avoid bot connection being locked all the time
79 for c in self.xmpp_connections.itervalues(): 79 for c in self.xmpp_connections.itervalues():
80 if hasattr(c, 'Process'): 80 if hasattr(c, 'Process'):
81 c.lock.acquire() 81 c.lock.acquire()
82 c.Process(0.5) 82 c.Process(0.01)
83 c.lock.release() 83 c.lock.release()
84 except RuntimeError: 84 except RuntimeError:
85 pass 85 pass
86 except (xml.parsers.expat.ExpatError, xmpp.protocol.XMLNotWellFormed): 86 except (xml.parsers.expat.ExpatError, xmpp.protocol.XMLNotWellFormed):
87 self.error('=> Debug: received invalid stanza', debug=True) 87 self.error('=> Debug: received invalid stanza', debug=True)