updated readme

Signed-off-by: Kenneth Reitz <me@kennethreitz.org>
This commit is contained in:
2017-09-02 19:29:02 -04:00
parent 4cd4b37c88
commit 12d15197c7
+8 -3
View File
@@ -31,15 +31,20 @@ Advanced Usage
::
from background import Worker
import background
worker = Worker(n=10, use_subprocess=True)
# Use 40 background threads.
background.n = 40
@worker.task
@background.task
def work():
import time
time.sleep(10)
@background.callback
def work_callback(future):
print(future)
for _ in range(100):
work()