Created
April 8, 2011 22:08
-
-
Save lost-theory/910835 to your computer and use it in GitHub Desktop.
pyres: defining a class and enqueueing it from the same file
This file contains 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
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