File tree 1 file changed +24
-3
lines changed
1 file changed +24
-3
lines changed Original file line number Diff line number Diff line change @@ -82,7 +82,7 @@ should be written to the output logger.
82
82
* basic_deliver: pika.Spec.Basic.Deliver instance
83
83
* properties: pika.Spec.BasicProperties instance (ex: headers)
84
84
* 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
86
86
87
87
* **Returns **: None
88
88
@@ -95,7 +95,6 @@ To run an instance you will need to make an instance of your worker by passing i
95
95
96
96
* mq_config: should house: user, password, server, port and vhost.
97
97
* 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
99
98
* logger: is an optional logger. Defaults to a logger to stderr
100
99
101
100
@@ -122,8 +121,30 @@ Example
122
121
' password' : ' guest' ,
123
122
}
124
123
125
- worker = IPrintStuff(mq_conf, output_dir = ' /tmp/logs/ ' )
124
+ worker = IPrintStuff(mq_conf)
126
125
worker.run_forever()
127
126
128
127
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
+
129
150
For a more in-depth example see the `examples/ <https://github.com/RHInception/re-worker/tree/master/examples >`_ folder.
You can’t perform that action at this time.
0 commit comments