Skip to content

Latest commit

 

History

History
37 lines (23 loc) · 1.02 KB

raw-runners.rst

File metadata and controls

37 lines (23 loc) · 1.02 KB

Raw runners

There's a set of raw operation runners that know how to run the default operations:

  • The callback runner that is able to run callback operations.
  • The chain runner that is able to chain operation runners that supports different operation types.

Callback runner

This is the runner that runs the Callback operations.

use Tolerance\Operation\Runner\CallbackOperationRunner;

$runner = new CallbackOperationRunner();
$result = $runner->run($operation);

Chain runner

Constructed by other runners, usually the raw ones, it uses the first one that supports to run the operation.

use Tolerance\Operation\Runner\ChainOperationRunner;
use Tolerance\Operation\Runner\CallbackOperationRunner;

$runner = new ChainOperationRunner([
    new CallbackOperationRunner(),
]);

$result = $runner->run($operation);

Also, the addOperationRunner method allows you to add another runner on the fly.