Skip to content

Instantly share code, notes, and snippets.

@dcramer
Created April 10, 2013 04:03
Show Gist options
  • Select an option

  • Save dcramer/5351704 to your computer and use it in GitHub Desktop.

Select an option

Save dcramer/5351704 to your computer and use it in GitHub Desktop.
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