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:
The DefaultPolicy is the default policy used by the worker.
It executes the tasks one by one in the order they are received.
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 new policy is as easy as it sounds, you only need to implement the ExecutionPolicyInterface.
Note: Each policy is automatically injected in the ExecutionPolicyRegistry.