Skip to content

MethodCallback

Canonical path: o6.server.MethodCallback

MethodCallback dataclass

Bases: Protocol

The shape of a Method implementation.

Registered with o6.call, Server.addMethod, or Server.implement. The callback may be a coroutine function, in which case the server awaits it on its own event loop.

See Methods.

Functions

__init__

__init__()

__call__

__call__(node, *inputs)

Run the Method.

Parameters:

Name Type Description Default
node ObjectNode

The Object the Method was called on.

required
inputs Any

The decoded InputArguments, in declaration order.

()

Returns:

Type Description
tuple[Any, ...] | Awaitable[tuple[Any, ...]]

A tuple of the StatusCode followed by the OutputArguments.