Celery v5.0.0 Documentationtasks import add >>> group(add.s(i, i) for i in range(10))().get() [0, 2, 4, 6, 8, 10, 12, 14, 16, 18] Partial group >>> g = group(add.s(i) for i in range(10)) >>> g(10).get() [10, 11, 12, 13, 14, 15, chord((add.s(i, i) for i in range(10)), xsum.s())().get() 90 A group chained to another task will be automatically converted to a chord: >>> (group(add.s(i, i) for i in range(10)) | xsum.s())().get() 90 Chunking splits a long list of arguments into parts, for example the operation: >>> items = zip(range(1000), range(1000)) # 1000 items >>> add.chunks(items, 10) will split the list of items into chunks of0 码力 | 2309 页 | 2.13 MB | 1 年前3
Celery v5.0.1 Documentationtasks import add >>> group(add.s(i, i) for i in range(10))().get() [0, 2, 4, 6, 8, 10, 12, 14, 16, 18] Partial group >>> g = group(add.s(i) for i in range(10)) >>> g(10).get() [10, 11, 12, 13, 14, 15, chord((add.s(i, i) for i in range(10)), xsum.s())().get() 90 A group chained to another task will be automatically converted to a chord: >>> (group(add.s(i, i) for i in range(10)) | xsum.s())().get() 90 Chunking splits a long list of arguments into parts, for example the operation: >>> items = zip(range(1000), range(1000)) # 1000 items >>> add.chunks(items, 10) will split the list of items into chunks of0 码力 | 2313 页 | 2.13 MB | 1 年前3
Celery v5.0.2 Documentationtasks import add >>> group(add.s(i, i) for i in range(10))().get() [0, 2, 4, 6, 8, 10, 12, 14, 16, 18] Partial group >>> g = group(add.s(i) for i in range(10)) >>> g(10).get() [10, 11, 12, 13, 14, 15, chord((add.s(i, i) for i in range(10)), xsum.s())().get() 90 A group chained to another task will be automatically converted to a chord: >>> (group(add.s(i, i) for i in range(10)) | xsum.s())().get() 90 Chunking splits a long list of arguments into parts, for example the operation: >>> items = zip(range(1000), range(1000)) # 1000 items >>> add.chunks(items, 10) will split the list of items into chunks of0 码力 | 2313 页 | 2.14 MB | 1 年前3
Celery v5.0.5 Documentationtasks import add >>> group(add.s(i, i) for i in range(10))().get() [0, 2, 4, 6, 8, 10, 12, 14, 16, 18] Partial group >>> g = group(add.s(i) for i in range(10)) >>> g(10).get() [10, 11, 12, 13, 14, 15, chord((add.s(i, i) for i in range(10)), xsum.s())().get() 90 A group chained to another task will be automatically converted to a chord: >>> (group(add.s(i, i) for i in range(10)) | xsum.s())().get() 90 Chunking splits a long list of arguments into parts, for example the operation: >>> items = zip(range(1000), range(1000)) # 1000 items >>> add.chunks(items, 10) will split the list of items into chunks of0 码力 | 2315 页 | 2.14 MB | 1 年前3
Celery 3.0 DocumentationLet’s break the chord expression down: >>> callback = tsum.s() >>> header = [add.s(i, i) for i in range(100)] >>> result = chord(header)(callback) >>> result.get() 9900 Remember, the callback can only print('Task {0!r} raised error: {1!r}'.format(request.id, exc)) >>> c = (group(add.s(i, i) for i in range(10)) | ... xsum.s().on_error(on_chord_error.s()))).delay() Important Notes Tasks used within map([range(10), range(100)]) [45, 4950] is the same as having a task doing: @app.task def temp(): return [xsum(range(10)), xsum(range(100))] and using starmap: >>> ~add.starmap(zip(range(10), range(10)))0 码力 | 2110 页 | 2.23 MB | 1 年前3
Celery v4.0.0 DocumentationLet’s break the chord expression down: >>> callback = tsum.s() >>> header = [add.s(i, i) for i in range(100)] >>> result = chord(header)(callback) >>> result.get() 9900 Remember, the callback can only print('Task {0!r} raised error: {1!r}'.format(request.id, exc)) >>> c = (group(add.s(i, i) for i in range(10)) | ... xsum.s().on_error(on_chord_error.s()))).delay() Important Notes Tasks used within map([range(10), range(100)]) [45, 4950] is the same as having a task doing: @app.task def temp(): return [xsum(range(10)), xsum(range(100))] and using starmap: >>> ~add.starmap(zip(range(10), range(10)))0 码力 | 2106 页 | 2.23 MB | 1 年前3
Celery v4.4.6 Documentationtasks import add >>> group(add.s(i, i) for i in range(10))().get() [0, 2, 4, 6, 8, 10, 12, 14, 16, 18] Partial group >>> g = group(add.s(i) for i in range(10)) >>> g(10).get() [10, 11, 12, 13, 14, 15, chord((add.s(i, i) for i in range(10)), xsum.s())().get() 90 A group chained to another task will be automatically converted to a chord: >>> (group(add.s(i, i) for i in range(10)) | xsum.s())().get() 90 Chunking splits a long list of arguments into parts, for example the operation: >>> items = zip(range(1000), range(1000)) # 1000 items >>> add.chunks(items, 10) will split the list of items into chunks of0 码力 | 1216 页 | 1.44 MB | 1 年前3
Celery v4.4.7 Documentationtasks import add >>> group(add.s(i, i) for i in range(10))().get() [0, 2, 4, 6, 8, 10, 12, 14, 16, 18] Partial group >>> g = group(add.s(i) for i in range(10)) >>> g(10).get() [10, 11, 12, 13, 14, 15, chord((add.s(i, i) for i in range(10)), xsum.s())().get() 90 A group chained to another task will be automatically converted to a chord: >>> (group(add.s(i, i) for i in range(10)) | xsum.s())().get() 90 Chunking splits a long list of arguments into parts, for example the operation: >>> items = zip(range(1000), range(1000)) # 1000 items >>> add.chunks(items, 10) will split the list of items into chunks of0 码力 | 1219 页 | 1.44 MB | 1 年前3
Celery v4.4.5 Documentationtasks import add >>> group(add.s(i, i) for i in range(10))().get() [0, 2, 4, 6, 8, 10, 12, 14, 16, 18] Partial group >>> g = group(add.s(i) for i in range(10)) >>> g(10).get() [10, 11, 12, 13, 14, 15, chord((add.s(i, i) for i in range(10)), xsum.s())().get() 90 A group chained to another task will be automatically converted to a chord: >>> (group(add.s(i, i) for i in range(10)) | xsum.s())().get() 90 Chunking splits a long list of arguments into parts, for example the operation: >>> items = zip(range(1000), range(1000)) # 1000 items >>> add.chunks(items, 10) will split the list of items into chunks of0 码力 | 1215 页 | 1.44 MB | 1 年前3
Celery 4.4.2 Documentationtasks import add >>> group(add.s(i, i) for i in range(10))().get() [0, 2, 4, 6, 8, 10, 12, 14, 16, 18] • Partial group >>> g = group(add.s(i) for i in range(10)) >>> g(10).get() [10, 11, 12, 13, 14, 15 chord((add.s(i, i) for i in range(10)), xsum.s())().get() 90 A group chained to another task will be automatically converted to a chord: >>> (group(add.s(i, i) for i in range(10)) | xsum.s())().get() 90 Chunking splits a long list of arguments into parts, for example the operation: >>> items = zip(range(1000), range(1000)) # 1000 items >>> add.chunks(items, 10) will split the list of items into chunks of0 码力 | 797 页 | 2.85 MB | 1 年前3
共 51 条
- 1
- 2
- 3
- 4
- 5
- 6













