示例#1
0
def new():
    """Get a new furious context and add it to the registry."""

    new_context = Context()

    _local.get_local_context().registry.append(new_context)

    return new_context
示例#2
0
def new(batch_size=None, **options):
    """Get a new furious context and add it to the registry. If a batch size is
    specified, use an AutoContext which inserts tasks in batches as they are
    added to the context.
    """

    if batch_size:
        new_context = AutoContext(batch_size=batch_size, **options)
    else:
        new_context = Context(**options)

    _local.get_local_context().registry.append(new_context)

    return new_context