File: join_reactor.py

package info (click to toggle)
python-eventlet 0.9.16-3
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 1,884 kB
  • sloc: python: 16,306; makefile: 97
file content (12 lines) | stat: -rw-r--r-- 422 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
"""Integrate eventlet with twisted's reactor mainloop.

You generally don't have to use it unless you need to call reactor.run()
yourself.
"""
from eventlet.hubs.twistedr import BaseTwistedHub
from eventlet.support import greenlets as greenlet
from eventlet.hubs import _threadlocal, use_hub

use_hub(BaseTwistedHub)
assert not hasattr(_threadlocal, 'hub')
hub = _threadlocal.hub = _threadlocal.Hub(greenlet.getcurrent())