Adds optional task_name argument

Makes it possible to name the task yourself.
This commit is contained in:
Ilan Steemers
2016-02-24 10:44:47 +01:00
parent 2e965b1631
commit 0a8f2e7e72
2 changed files with 6 additions and 1 deletions
+1 -1
View File
@@ -24,7 +24,7 @@ def async(func, *args, **kwargs):
tag = uuid() tag = uuid()
# build the task package # build the task package
task = {'id': tag[1], task = {'id': tag[1],
'name': tag[0], 'name': q_options.pop('task_name', None) or tag[0],
'func': func, 'func': func,
'args': args} 'args': args}
# push optionals # push optionals
+5
View File
@@ -69,6 +69,11 @@ broker
"""""" """"""
A broker instance, in case you want to control your own connections. A broker instance, in case you want to control your own connections.
task_name
"""""""""
Optionally overwrites the auto-generated task name.
q_options q_options
""""""""" """""""""
None of the option keywords get passed on to the task function. None of the option keywords get passed on to the task function.