Add ability to launch background task right now as normal function:
from background_task import background
@background
def add(x,y):
return x+y
add(2, 2) # create a task
add.now(2, 2) # launch it right now and got answer 4.
Today we can do it using add.task_function(2,2) but proposed now shortcut is cleaner and simpler.
Add ability to launch background task right now as normal function:
Today we can do it using
add.task_function(2,2)
but proposednow
shortcut is cleaner and simpler.