Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 13 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,16 +49,17 @@ Create a sample project and write a simple task :
$ vim tasks.py
```


from mrq.task import Task
import urllib2

class Fetch(Task):
def run(self, params):
f = urllib2.urlopen(params.get("url"))
t = f.read()
f.close()
return len(t)
```python
from mrq.task import Task
import urllib2

class Fetch(Task):
def run(self, params):
f = urllib2.urlopen(params.get("url"))
t = f.read()
f.close()
return len(t)
```

You can now run it using `mrq-run` :
```
Expand Down Expand Up @@ -93,7 +94,7 @@ $ mrq-run --async --queue fetches tasks.Fetch url http://www.google.com &&

Now start the dasbhoard with `mrq-dashboard &` and go check your newly created queue and job on [localhost:5555](http://localhost:5555/#jobs)

Instanciate a worker with `mrq-worker` and you can follow it on the dashboard as it executes in parallel all the enqueued jobs
Instantiate a worker with `mrq-worker` and you can follow it on the dashboard as it executes in parallel all the enqueued jobs

```
$ mrq-worker --gevent 10 fetches
Expand Down Expand Up @@ -122,4 +123,4 @@ $ mrq-worker --gevent 10 fetches

# More

Full documentation is available on [readthedocs](http://mrq.readthedocs.org/en/latest/)
Full documentation is available on [readthedocs](http://mrq.readthedocs.org/en/latest/)