mirror of
https://github.com/kennethreitz/background.git
synced 2026-06-05 23:10:18 +00:00
@@ -36,6 +36,7 @@ Advanced Usage
|
||||
# Use 40 background threads.
|
||||
background.n = 40
|
||||
|
||||
|
||||
@background.task
|
||||
def work():
|
||||
import time
|
||||
@@ -45,6 +46,7 @@ Advanced Usage
|
||||
def work_callback(future):
|
||||
print(future)
|
||||
|
||||
|
||||
for _ in range(100):
|
||||
work()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user