Skip to content

VariableReadCallback

Canonical path: o6.server.VariableReadCallback

VariableReadCallback

Bases: Protocol

The shape of a Variable value-read implementation.

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

See Variables.

Functions

__call__

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

Produce the value of the Variable.

Parameters:

Name Type Description Default
node VariableNode

The Variable being read.

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

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

required
session Session | None

The reading session, or None for an internal read.

required
includeSourceTimestamp bool

Whether the caller wants a SourceTimestamp.

required

Returns:

Type Description
tuple[Any, ...]

A tuple of the StatusCode and the value.