Skip to content

Latest commit

 

History

History
43 lines (25 loc) · 1.21 KB

execution_policies.md

File metadata and controls

43 lines (25 loc) · 1.21 KB

Execution policies

Execution policies are the policies used by the worker to execute tasks.

The execution policy is configured via the worker:

scheduler_bundle:
    # ...

    worker:
        mode: 'default'

Supported policies:

Extending the policies:

DefaultPolicy

The DefaultPolicy is the default policy used by the worker.

It executes the tasks one by one in the order they are received.

FiberPolicy

Requires PHP >= 8.1

The FiberPolicy uses Fibers to execute tasks, a fiber is created for each task.

It executes the tasks one by one in the order they are received.

Creating a custom execution policy

Creating a new policy is as easy as it sounds, you only need to implement the ExecutionPolicyInterface.

Note: Each policy is automatically injected in the ExecutionPolicyRegistry.