Skip to content

VariableWriteCallback

Canonical path: o6.server.VariableWriteCallback

VariableWriteCallback

Bases: Protocol

The shape of a Variable value-write implementation.

Registered with o6.write or Server.addVariable. The callback runs on the server's event loop, so it must not block.

See Variables.

Functions

__call__

__call__(node, value, *, range, session)

Accept or reject a write to the Variable.

Parameters:

Name Type Description Default
node VariableNode

The Variable being written.

required
value DataValue

The requested DataValue.

required
range tuple[slice, ...] | None

The requested index range, or None for the whole value.

required
session Session | None

The writing session, or None for an internal write.

required

Returns:

Type Description
tuple[StatusCode]

A one-tuple holding the StatusCode of the write.