Skip to content

Commit b321e20

Browse files
committed
Updated reworker for changes that happened to push output to the bus.
1 parent 9791680 commit b321e20

File tree

1 file changed

+24
-3
lines changed

1 file changed

+24
-3
lines changed

libraries/reworker.rst

+24-3
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ should be written to the output logger.
8282
* basic_deliver: pika.Spec.Basic.Deliver instance
8383
* properties: pika.Spec.BasicProperties instance (ex: headers)
8484
* body: dict or list that was json loaded off the message
85-
* output: logger instance to send output
85+
* output: logger like instance to send output
8686

8787
* **Returns**: None
8888

@@ -95,7 +95,6 @@ To run an instance you will need to make an instance of your worker by passing i
9595

9696
* mq_config: should house: user, password, server, port and vhost.
9797
* config_file: is an optional full path to a json config file
98-
* output_dir: is the directory for process logs to be written to
9998
* logger: is an optional logger. Defaults to a logger to stderr
10099

101100

@@ -122,8 +121,30 @@ Example
122121
'password': 'guest',
123122
}
124123
125-
worker = IPrintStuff(mq_conf, output_dir='/tmp/logs/')
124+
worker = IPrintStuff(mq_conf)
126125
worker.run_forever()
127126
128127
128+
To Turn this into a runnable script you'll rant to use ``reworker.worker.runner`` like so:
129+
130+
131+
Example
132+
~~~~~~~
133+
134+
.. code-block:: python
135+
136+
from reworker.worker import Worker
137+
138+
class IPrintStuff(Worker):
139+
...
140+
141+
142+
def main():
143+
from reworker.worker import runner
144+
runner(IPrintStuff)
145+
146+
147+
if __name__ == '__main__':
148+
main()
149+
129150
For a more in-depth example see the `examples/ <https://github.com/RHInception/re-worker/tree/master/examples>`_ folder.

0 commit comments

Comments
 (0)