$worker

iii-state

v0.20.0-next.1

Distributed key-value state management with reactive change triggers.

engine module
baked into the iii engine; no separate install required.

functions

7

iii-state::on-config-change

function

Internal: re-apply the iii-state configuration when the authoritative configuration entry changes.

request
valueunknown
response
valueunknown

state::delete

function

Delete a value from state

request
  • keystringrequired

    Identifier for the value to delete within the scope.

  • scopestringrequired

    Namespace that groups related keys.

response
valueunknown

state::get

function

Get a value from state

request
  • keystringrequired

    Identifier for the value within the scope.

  • scopestringrequired

    Namespace that groups related keys.

response
valueunknown

state::list

function

Get a group from state

request
  • scopestringrequired

    Namespace whose keys should be listed as a group.

response
valueunknown

state::list_groups

function

List all state groups

request
empty object
response
  • groupsstring[]required

state::set

function

Set a value in state

request
  • keystringrequired

    Identifier for the value within the scope.

  • scopestringrequired

    Namespace that groups related keys (e.g. `users`, `orders`).

  • valueunknownrequired

    Arbitrary JSON value to store. Replaces any existing value at `scope`/`key`.

response
  • new_valueunknownrequired

    The value after the update

  • old_valueunknown

    The value before the update (None if key didn't exist)

state::update

function

Update a value in state

request
  • keystringrequired

    Identifier for the value to update within the scope.

  • opsone of[]required

    Ordered list of update operations applied atomically to the existing value.

    one of (6)
    variant 1
    • pathstringrequired
    • typestringrequiredenum: set
    • valueunknown
    variant 2
    • pathany of
      … expand 2 nested
      any of (2)
      variant 1
      any of (2)
      variant 1
      valuestring
      variant 2
      itemsstring[]
      variant 2
      valuenull
    • typestringrequiredenum: merge
    • valueunknownrequired
    variant 3
    • byinteger· int64required
    • pathstringrequired
    • typestringrequiredenum: increment
    variant 4
    • byinteger· int64required
    • pathstringrequired
    • typestringrequiredenum: decrement
    variant 5
    • pathany of
      … expand 2 nested
      any of (2)
      variant 1
      any of (2)
      variant 1
      valuestring
      variant 2
      itemsstring[]
      variant 2
      valuenull
    • typestringrequiredenum: append
    • valueunknownrequired
    variant 6
    • pathstringrequired
    • typestringrequiredenum: remove
  • scopestringrequired

    Namespace that groups related keys.

response
  • errorsobject[]

    Errors encountered while applying ops. Successfully applied ops are still reflected in `new_value`. Field is omitted from JSON when empty for backward compatibility.

    • codestringrequired

      Stable error code, e.g. `"merge.path.too_deep"`.

    • doc_urlstring

      Optional documentation URL for this error class.

    • messagestringrequired

      Human-readable description with concrete numbers when applicable.

    • op_indexinteger· uintrequiredmin 0

      Index of the offending op within the original `ops` array.

  • new_valueunknownrequired

    The value after the update

  • old_valueunknown

    The value before the update (None if key didn't exist)

triggers

1

state

trigger

State trigger

invocation
  • condition_function_idstring

    Optional function ID to evaluate before invoking handler

  • keystring

    State key to watch (exact match filter)

  • scopestring

    State scope to watch (exact match filter)

return
  • event_typeall ofrequired

    Type of state change

    all of (1)
    variant 1
    valuestringenum: state:created, state:updated, state:deleted
  • keystringrequired

    State key

  • new_valueunknownrequired

    New value

  • old_valueunknown

    Previous value (null for created events)

  • scopestringrequired

    State scope

  • typestringrequired

    Always "state"