diff options
author | Valery Piashchynski <[email protected]> | 2021-08-09 17:10:07 +0300 |
---|---|---|
committer | Valery Piashchynski <[email protected]> | 2021-08-09 17:10:07 +0300 |
commit | fba3d927b62f8963f0c291da2739061e726df32e (patch) | |
tree | 37fd54198f1b4939c0b78435c22817ca0c5facd9 /plugins | |
parent | 606e2170ccac5a13a11198aaf54e4219a83291ab (diff) |
Update goridge to v3.2.0, update all frames operations.
Signed-off-by: Valery Piashchynski <[email protected]>
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/jobs/plugin.go | 2 | ||||
-rw-r--r-- | plugins/jobs/response_protocol.md | 47 |
2 files changed, 48 insertions, 1 deletions
diff --git a/plugins/jobs/plugin.go b/plugins/jobs/plugin.go index d2d2ed9f..6c848a9d 100644 --- a/plugins/jobs/plugin.go +++ b/plugins/jobs/plugin.go @@ -31,7 +31,7 @@ const ( ) type Plugin struct { - cfg *Config `mapstructure:"jobs"` + cfg *Config `structure:"jobs"` log logger.Logger sync.RWMutex diff --git a/plugins/jobs/response_protocol.md b/plugins/jobs/response_protocol.md new file mode 100644 index 00000000..c1d32e7a --- /dev/null +++ b/plugins/jobs/response_protocol.md @@ -0,0 +1,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 + } +} +``` |