Created
August 8, 2012 20:44
-
-
Save FrancescaK/3298609 to your computer and use it in GitHub Desktop.
worker role
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
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