Created
January 21, 2014 21:30
-
-
Save queertypes/8548791 to your computer and use it in GitHub Desktop.
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
import random | |
import time | |
import uuid | |
import pyrax | |
pyrax.set_credential_file('/whatever') | |
pyrax.queues.client_id = str(uuid.uuid4()) | |
pid_gen = lambda: str(random.randint(1, 999999)) | |
while True: | |
project = pid() | |
body = {'start': 1, 'end': 2, 'type': 'usage', 'total': 100, | |
'project_id': project, 'event_id': str(uuid.uuid4()), | |
'data_center': 'ORD1'} | |
print('Posting on behalf of %s' % project) | |
pyrax.queues.post_message('tasks', ttl=120, body=body) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Needs
time.sleep(1)
above.