import sys
import time
import thoonk
def main():
client = thoonk.Thoonk(listen=True)
# got exception in ThoonkListener thread
time.sleep(5)
print 'Normal exit'
if __name__ == '__main__':
sys.exit(main())
Output:
$ python thoonk-fail.py
Exception in thread Thread-1:
Traceback (most recent call last):
File "/usr/lib/python2.7/threading.py", line 551, in __bootstrap_inner
self.run()
File "/usr/share/devel/WSA/_env_/local/lib/python2.7/site-packages/thoonk/pubsub.py", line 311, in run
for event in self._pubsub.listen():
File "/usr/share/devel/WSA/_env_/local/lib/python2.7/site-packages/redis/client.py", line 1871, in listen
r = self.parse_response()
File "/usr/share/devel/WSA/_env_/local/lib/python2.7/site-packages/redis/client.py", line 1815, in parse_response
response = self.connection.read_response()
AttributeError: 'NoneType' object has no attribute 'read_response'
Normal exit
Take simple example:
Output:
redis monitor:
PS Is project alive?