File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -49,16 +49,17 @@ Create a sample project and write a simple task :
4949 $ vim tasks.py
5050```
5151
52-
53- from mrq.task import Task
54- import urllib2
55-
56- class Fetch(Task):
57- def run(self, params):
58- f = urllib2.urlopen(params.get("url"))
59- t = f.read()
60- f.close()
61- return len(t)
52+ ``` python
53+ from mrq.task import Task
54+ import urllib2
55+
56+ class Fetch (Task ):
57+ def run (self , params ):
58+ f = urllib2.urlopen(params.get(" url" ))
59+ t = f.read()
60+ f.close()
61+ return len (t)
62+ ```
6263
6364You can now run it using ` mrq-run ` :
6465```
@@ -93,7 +94,7 @@ $ mrq-run --async --queue fetches tasks.Fetch url http://www.google.com &&
9394
9495Now start the dasbhoard with ` mrq-dashboard & ` and go check your newly created queue and job on [ localhost:5555] ( http://localhost:5555/#jobs )
9596
96- Instanciate a worker with ` mrq-worker ` and you can follow it on the dashboard as it executes in parallel all the enqueued jobs
97+ Instantiate a worker with ` mrq-worker ` and you can follow it on the dashboard as it executes in parallel all the enqueued jobs
9798
9899```
99100$ mrq-worker --gevent 10 fetches
@@ -122,4 +123,4 @@ $ mrq-worker --gevent 10 fetches
122123
123124# More
124125
125- Full documentation is available on [ readthedocs] ( http://mrq.readthedocs.org/en/latest/ )
126+ Full documentation is available on [ readthedocs] ( http://mrq.readthedocs.org/en/latest/ )
You can’t perform that action at this time.
0 commit comments