aboutsummaryrefslogtreecommitdiffstats
path: root/bin
diff options
context:
space:
mode:
authorjason2016-05-24 16:49:54 -0600
committerjason2016-05-24 16:49:54 -0600
commita592ba06ea019bbb0051ffe5fc006d98560d038a (patch)
tree588590a6423a19c59aa2cac9f57b7025f4f5f44b /bin
parent2c599d965493b3658ffadc0c3e9e1b5a209cf1ba (diff)
downloadeventmq-a592ba06ea019bbb0051ffe5fc006d98560d038a.tar.gz
eventmq-a592ba06ea019bbb0051ffe5fc006d98560d038a.zip
More work for named queues
- Rename `WORKERS` setting to `CONCURRENT_JOBS` for more clarity. Added this setting to the command line options, the ini .conf & default settings conf.py files. - Added support for JSON style arrays in INI config. - Added support for weighted named queues. The style for the setting is [[weight, "name"], [weight, "name"]]. Configured in both the INI and command line for job manager. Added documentation. - Updated the spec for the INFORM message. Weights are sent with the queue names. If there are no weights specified they will be given the default value of 0. - updated Router.queues to a list from a deque so that it can be sorted by priority more easily.
Diffstat (limited to 'bin')
-rwxr-xr-xbin/emq-jobmanager18
1 files changed, 14 insertions, 4 deletions
diff --git a/bin/emq-jobmanager b/bin/emq-jobmanager
index 82c2e9b..4071ada 100755
--- a/bin/emq-jobmanager
+++ b/bin/emq-jobmanager
@@ -21,12 +21,19 @@ from eventmq.jobmanager import JobManager
21from eventmq import conf 21from eventmq import conf
22 22
23if __name__ == "__main__": 23if __name__ == "__main__":
24 parser = argparse.ArgumentParser(description='Listen for requests') 24 parser = argparse.ArgumentParser(description='Listen for job requests and '
25 parser.add_argument('--config', '-c', type=str, nargs='?', 25 'manage their execution')
26 parser.add_argument('--broker-addr', '-B', type=str, nargs='?',
27 help='manually specify the broker address to connect '
28 'to in order to receive jobs')
29 parser.add_argument('--config', '-C', type=str, nargs='?',
26 help='manually specify the location of eventmq.conf') 30 help='manually specify the location of eventmq.conf')
27 parser.add_argument('--queues', '-Q', type=str, nargs='+', 31 parser.add_argument('--queues', '-Q', type=str, nargs='+',
28 help='space separated list of queue names to listen ' 32 help='space separated list of queue names to listen '
29 'on') 33 'on')
34 parser.add_argument('--jobs', '-J', type=int, nargs='?',
35 help='the max number of concurrent jobs to manage at '
36 'a time')
30 37
31 args = parser.parse_args() 38 args = parser.parse_args()
32 39
@@ -39,5 +46,8 @@ if __name__ == "__main__":
39 if queues: 46 if queues:
40 queues = ','.join(queues) 47 queues = ','.join(queues)
41 48
42 j = JobManager(queues=queues) 49 broker_addr = args.broker_addr
43 j.jobmanager_main() 50 concurrent_jobs = args.jobs
51
52 j = JobManager(queues=queues, concurrent_jobs=concurrent_jobs)
53 j.jobmanager_main(broker_addr=broker_addr)