forked from treehouselabs/worker-bundle
-
Notifications
You must be signed in to change notification settings - Fork 0
/
ExecutorInterface.php
38 lines (33 loc) · 1019 Bytes
/
ExecutorInterface.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
<?php
namespace TreeHouse\WorkerBundle\Executor;
use Symfony\Component\OptionsResolver\Exception\ExceptionInterface;
use Symfony\Component\OptionsResolver\OptionsResolver;
interface ExecutorInterface
{
/**
* The name of this executor, corresponds directly with a tube name.
* The naming convention is the same as that of services and events, ie:
* lowercased, separated by periods, eg: `entity.update`.
*
* @return string
*/
public function getName();
/**
* Executes a job with given payload.
*
* @param array $payload
*
* @return mixed
*/
public function execute(array $payload);
/**
* Configures the payload for this executor.
* You can throw an optionsresolver exception if an invalid payload is
* given to a job, in which case the job will be deleted.
*
* @param OptionsResolver $resolver
*
* @throws ExceptionInterface
*/
public function configurePayload(OptionsResolver $resolver);
}