Skip to content

Instantly share code, notes, and snippets.

@FrancescaK
Created August 8, 2012 20:44
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 FrancescaK/3298609 to your computer and use it in GitHub Desktop.
Save FrancescaK/3298609 to your computer and use it in GitHub Desktop.
worker role
def worker():
while True:
time.sleep(1)
while True:
msg = mongo_db.sendq.find_and_modify(remove=True)
if (msg == None): break
sys.stderr.write("send %s %s\n" % (msg['To'], msg['Body']))
message = twilio_client.sms.messages.create(to=msg['To'],
from_=twilio_fromnum,
body=msg['Body'])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment