blob: e195c407f9511a0eeed34b8b1783dabb1f95d5d2 (
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
48
49
50
51
52
53
54
|
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,
`delay_seconds`: to delay a queue for a provided amount of seconds, `headers` - job's headers represented as hashmap
with string key and array of strings as a value.
For example:
`NO_ERROR`:
For example:
```json
{
"type": 0,
"data": {}
}
```
`ERROR`:
```json
{
"type": 1,
"data": {
"message": "internal worker error",
"requeue": true,
"headers": [
{
"test": [
"1",
"2",
"3"
]
}
],
"delay_seconds": 10
}
}
```
|