Guest User

Untitled

a guest
Jan 22nd, 2018
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.77 KB | None | 0 0
  1. #status()-> insert() -> read() ->compare(), propagate ret from compare into status()
  2.  
  3. @task
  4. def status(email, callback=None):
  5.  
  6. ret = insert.delay(email, callback=subtask(read, callback=subtask(compare)))
  7.  
  8. #i want to propagate return 'somedata' from compare here
  9.  
  10. @task
  11. def insert(email, callback=None):
  12. ehash = email
  13.  
  14. if callback:
  15. subtask(callback).delay(ehash)
  16.  
  17.  
  18. @task
  19. def read(ehash, callback=None):
  20.  
  21. nhash = 'bemail'
  22.  
  23. if callback:
  24. subtask(callback).delay(ehash, nhash)
  25.  
  26.  
  27. @task
  28. def compare(ehash, nhash):
  29.  
  30. if ehash == nhash:
  31. print 'ZHODA'
  32. else:
  33. print 'NEZHODA'
  34.  
  35. return 'somedata'
Add Comment
Please, Sign In to add comment