Created
April 10, 2013 04:03
-
-
Save dcramer/5351704 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from gevent import Greenlet | |
| class Config(object): | |
| def __init__(self): | |
| self.url = 'http://localhost:9000/' | |
| self.timeout = 5 | |
| class EventLoop(Greenlet): | |
| def __init__(self, config): | |
| Greenlet.__init__(self) | |
| self.config = config | |
| def _run(self): | |
| while True: | |
| self.run() | |
| class DispatchLoop(EventLoop): | |
| def run(self): | |
| class ReceiveLoop(EventLoop): | |
| def run(self): |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment