robonix_api.result¶
Lifecycle handler return type.
Every @<provider>.on_init / on_activate / on_deactivate / on_shutdown handler MUST return one of Ok / Err / Deferred. Only on_init receives cfg: dict (the CMD_INIT config_json, JSON-decoded); the other three take no args. Don’t raise — the framework will catch and convert raises into Err(repr(exc)) defensively but logs a warning telling you to use Err(…) explicitly instead.
Ok() — handler succeeded; framework advances state. Err(”…”) — handler failed; provider goes to ERROR. Deferred(”…”) — handler can’t proceed yet; provider stays in
current state. v0.1 reports the reason to the operator and moves on (no deferred queue).
Classes
|
Handler can't proceed yet — typically waiting for an upstream provider to come online, a sensor to publish first message, etc. |
|
Handler failed. |
|
Handler succeeded. |
- class robonix_api.result.Deferred(reason: str)[source]¶
Bases:
objectHandler can’t proceed yet — typically waiting for an upstream provider to come online, a sensor to publish first message, etc. The provider stays in its current state; framework expects the operator or eviction policy to retry later. reason is shown in rbnx caps.
- reason: str¶