Django Q Documentation Release 1.3.6
django_q.tasks import async_task, result # create the task async_task('math.copysign', 2, -2) # or with import and storing the id import math.copysign task_id = async_task(copysign, 2, -2) # get the result task_result = result(task_id, 200) # but in most cases you will want to use a hook: async_task('math.modf', 2.5, hook='hooks.print_result') # hooks.py (continues on next page) 18 Chapter 1. Features call: # Async options in a dict opts = {'hook': 'hooks.print_result', 'group': 'math', 'timeout': 30} async_task('math.modf', 2.5, q_options=opts) Please note that this will override any other option0 码力 | 62 页 | 452.10 KB | 1 年前3Django Q Documentation Release 1.3.6
django_q.tasks import async_task, result # create the task async_task('math.copysign', 2, -2) # or with import and storing the id import math.copysign task_id = async_task(copysign, 2, -2) # get the result task_result = result(task_id, 200) # but in most cases you will want to use a hook: async_task('math.modf', 2.5, hook='hooks.print_result') # hooks.py def print_result(task): print(task.result) async_task() call: # Async options in a dict opts = {'hook': 'hooks.print_result', 'group': 'math', 'timeout': 30} async_task('math.modf', 2.5, q_options=opts) Please note that this will override any other option0 码力 | 64 页 | 453.51 KB | 1 年前3Django Q Documentation Release 0.7.13
from django_q.tasks import async, result # create the task async('math.copysign', 2, -2) # or with import and storing the id import math.copysign task_id = async(copysign, 2, -2) # get the result task_result for it task_result = result(task_id, 200) # but in most cases you will want to use a hook: async('math.modf', 2.5, hook='hooks.print_result') # hooks.py def print_result(task): print(task.result) async() call: # Async options in a dict opts = {'hook': 'hooks.print_result', 'group': 'math', 'timeout': 30} async('math.modf', 2.5, q_options=opts) Please note that this will override any other option keywords0 码力 | 56 页 | 416.37 KB | 1 年前3Django Q Documentation Release 0.7.11
from django_q.tasks import async, result # create the task async('math.copysign', 2, -2) # or with import and storing the id import math.copysign task_id = async(copysign, 2, -2) # get the result task_result for it task_result = result(task_id, 200) # but in most cases you will want to use a hook: async('math.modf', 2.5, hook='hooks.print_result') # hooks.py def print_result(task): print(task.result) async() call: # Async options in a dict opts = {'hook': 'hooks.print_result', 'group': 'math', 'timeout': 30} async('math.modf', 2.5, q_options=opts) Please not that this will override any other option keywords0 码力 | 54 页 | 412.45 KB | 1 年前3Django Q Documentation Release 0.7.12
from django_q.tasks import async, result # create the task async('math.copysign', 2, -2) # or with import and storing the id import math.copysign task_id = async(copysign, 2, -2) # get the result task_result for it task_result = result(task_id, 200) # but in most cases you will want to use a hook: async('math.modf', 2.5, hook='hooks.print_result') # hooks.py def print_result(task): print(task.result) async() call: # Async options in a dict opts = {'hook': 'hooks.print_result', 'group': 'math', 'timeout': 30} async('math.modf', 2.5, q_options=opts) Please note that this will override any other option keywords0 码力 | 56 页 | 415.46 KB | 1 年前3Django Q Documentation Release 1.3.6
django_q.tasks import async_task, result # create the task async_task('math.copysign', 2, -2) # or with import and storing the id import math.copysign task_id = async_task(copysign, 2, -2) # get the result task_result = result(task_id, 200) # but in most cases you will want to use a hook: async_task('math.modf', 2.5, hook='hooks.print_result') # hooks.py def print_result(task): print(task.result) Async options in a dict opts = {'hook': 'hooks.print_result', 'group': 'math', 'timeout': 30} async_task('math.modf', 2.5, q_options=opts) Please note that this will override any other option0 码力 | 81 页 | 512.48 KB | 1 年前3Django Q Documentation Release 1.3.6
django_q.tasks import async_task, result # create the task async_task('math.copysign', 2, -2) # or with import and storing the id import math.copysign task_id = async_task(copysign, 2, -2) # get the result task_result = result(task_id, 200) # but in most cases you will want to use a hook: async_task('math.modf', 2.5, hook='hooks.print_result') # hooks.py def print_result(task): print(task.result) Async options in a dict opts = {'hook': 'hooks.print_result', 'group': 'math', 'timeout': 30} async_task('math.modf', 2.5, q_options=opts) Please note that this will override any other option0 码力 | 81 页 | 512.34 KB | 1 年前3Django Q Documentation Release 0.7.17
from django_q.tasks import async, result # create the task async('math.copysign', 2, -2) # or with import and storing the id import math.copysign task_id = async(copysign, 2, -2) # get the result task_result for it task_result = result(task_id, 200) # but in most cases you will want to use a hook: async('math.modf', 2.5, hook='hooks.print_result') # hooks.py def print_result(task): print(task.result) async() call: # Async options in a dict opts = {'hook': 'hooks.print_result', 'group': 'math', 'timeout': 30} async('math.modf', 2.5, q_options=opts) Please note that this will override any other option keywords0 码力 | 56 页 | 416.84 KB | 1 年前3Django Q Documentation Release 0.7.11
from django_q.tasks import async, result # create the task async('math.copysign', 2, -2) # or with import and storing the id import math.copysign task_id = async(copysign, 2, -2) # get the result task_result for it task_result = result(task_id, 200) # but in most cases you will want to use a hook: async('math.modf', 2.5, hook='hooks.print_result') # hooks.py def print_result(task): print(task.result) Async options in a dict opts = {'hook': 'hooks.print_result', 'group': 'math', 'timeout': 30} async('math.modf', 2.5, q_options=opts) Please not that this will override any other option0 码力 | 72 页 | 526.88 KB | 1 年前3Django Q Documentation Release 0.7.14
from django_q.tasks import async, result # create the task async('math.copysign', 2, -2) # or with import and storing the id import math.copysign task_id = async(copysign, 2, -2) # get the result task_result for it task_result = result(task_id, 200) # but in most cases you will want to use a hook: async('math.modf', 2.5, hook='hooks.print_result') # hooks.py def print_result(task): print(task.result) Async options in a dict opts = {'hook': 'hooks.print_result', 'group': 'math', 'timeout': 30} async('math.modf', 2.5, q_options=opts) Please note that this will override any other option0 码力 | 73 页 | 527.40 KB | 1 年前3
共 198 条
- 1
- 2
- 3
- 4
- 5
- 6
- 20