Skip to content

Instantly share code, notes, and snippets.

@lost-theory
Created April 8, 2011 22:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lost-theory/910835 to your computer and use it in GitHub Desktop.
Save lost-theory/910835 to your computer and use it in GitHub Desktop.
pyres: defining a class and enqueueing it from the same file
class Adder(object):
queue = "Adder"
@staticmethod
def perform(a, b):
return a+b
if __name__ == "__main__":
import random
from pyres import ResQ
resq = ResQ()
resq.enqueue(Adder, random.randint(1, 10**6), random.randint(1, 10**6))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment