Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
import pyev
class FiveSecondTimer(object):
def __init__(self, data):
self.data = data
def __call__(self, watch, revents):
print 'foo', data
loop = pyev.default_loop()
run_every_5_seconds = FiveSecondTimer([1, 2, 3])
run_every_5_seconds_loop = loop.timer(0, 5, run_every_5_seconds)
run_every_5_seconds_loop.start()
loop.start()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment