Skip to content

Commit

Permalink
Update readme with .forever() blocking example
Browse files Browse the repository at this point in the history
  • Loading branch information
blakev committed Oct 19, 2017
1 parent f2bbe89 commit d783eb3
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,16 +66,18 @@ from gevent_tasks import Task, cron
Task('PrintHi', print_hi, interval=cron('* * * * *'))
```

The manager instance can also be used to register tasks via decorator,
The manager instance can also be used to register tasks via decorator. Calling
`TaskManager.forever()` will block the code until there are no longer scheduled tasks or until an `Exception`
is thrown inside one of the running Tasks.

```python
manage = TaskManager(TaskPool(size=3))
manage = TaskManager()

@manage.task(interval=cron('* * * * *'))
def every_minute(task, *args):
print('hi', args, task, task.timing)

manage.start_all()
manage.forever()
```

### Attribution
Expand Down

0 comments on commit d783eb3

Please sign in to comment.