~hudson-openstack/burrow/trunk

« back to all changes in this revision

Viewing changes to examples/client.py

  • Committer: Tarmac
  • Author(s): Eric Day
  • Date: 2011-08-29 16:58:05 UTC
  • mfrom: (38.1.3 examples)
  • Revision ID: tarmac-20110829165805-ksagqjhk1rbxsyqc
Added examples, bumped version.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/usr/bin/env python
 
2
 
 
3
'''Insert work to be done for a worker.'''
 
4
 
 
5
import sys
 
6
 
 
7
import burrow
 
8
 
 
9
 
 
10
body = None
 
11
if len(sys.argv) == 2:
 
12
    body = sys.stdin.read()
 
13
elif len(sys.argv) == 3:
 
14
    body = sys.argv[2]
 
15
else:
 
16
    print 'Usage: %s <message id> [message body]' % sys.argv[0]
 
17
    sys.exit(1)
 
18
 
 
19
queue = burrow.Queue('test_account', 'test_queue')
 
20
queue.create_message(sys.argv[1], body)