summaryrefslogtreecommitdiff
path: root/plugins/jobs/response_protocol.md
blob: c1d32e7a1345287a3f2c768a11560d2847e9027e (plain)
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
39
40
41
42
43
44
45
46
47
Response protocol used to communicate between worker and RR. When a worker completes its job, it should send a typed
response. The response should contain:

1. `type` field with the message type. Can be treated as enums.
2. `data` field with the dynamic response related to the type.

Types are:

```
0 - NO_ERROR
1 - ERROR
2 - ...
```

----
`NO_ERROR`: contains only `type` and empty `data`.

----
`ERROR` : contains `type`: 1, and `data` field with: `message` describing the error, `requeue` flag to requeue the job,
`dalay_seconds`: to delay a queue for a provided amount of seconds.
----

For example:

`NO_ERROR`:
For example:

```json
{
    "type": 0,
    "data": {}
}

```

`ERROR`:

```json
{
    "type": 1,
    "data": {
        "message": "internal worker error",
        "requeue": true,
        "delay_seconds": 10
    }
}
```