robonix_api.result

Return types for lifecycle handlers.

Every on_init, on_activate, on_deactivate, and on_shutdown handler returns one of the following values:

  • Ok: the handler succeeded and the framework advances state.

  • Err: the handler failed and the provider enters ERROR.

  • Deferred: the handler cannot proceed and the provider remains in its current state. Version 0.1 reports the reason but has no deferred queue.

Only on_init receives the decoded cfg dictionary. Raising an exception is converted defensively to Err, but returning Err explicitly produces clearer diagnostics.

Classes

Deferred(reason)

Handler can't proceed yet — typically waiting for an upstream provider to come online, a sensor to publish first message, etc.

Err(message)

Handler failed.

Ok()

Handler succeeded.

class robonix_api.result.Deferred(reason: str)[source]

Bases: object

Handler 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
class robonix_api.result.Err(message: str)[source]

Bases: object

Handler failed. message shows up in rbnx caps state_detail and atlas’s logs. Use this for both expected failures (config invalid, dependency missing) and caught exceptions.

message: str
class robonix_api.result.Ok[source]

Bases: object

Handler succeeded. Carries no payload — the lifecycle framework advances state based on which CMD_* the handler ran on, not on the return value.