Skip to content

o6.client.Subscription

Represents an OPC UA subscription for monitoring data changes.

o6.client.Subscription

Represents an OPC UA subscription for monitoring data changes.

Functions

__await__

__await__()

Allow await Subscription(...) to work.

Creating a subscription requires a server round-trip, but __init__ cannot be async. The round-trip is therefore started in __init__ and awaited here, so callers can write sub = await Subscription(...) and be sure the subscription is fully set up before proceeding.

__bool__

__bool__()

Check if this is a valid subscription.

A deleted subscription evaluates to False. delete() cleans up the subscription on the server and client side, but cannot interfere with garbage collection of the Python object itself. Garbage collecting a deleted subscription is a noop in terms of state cleanup, but until then __bool__ indicates that the subscription is invalid.

delete

delete()

Delete this subscription from the server.

Returns:

Type Description
MaybeAwaitable[None]

The raw result of the delete operation.

modify

modify(
    publishing_interval=None,
    lifetime_count=None,
    max_keepalive_count=None,
    max_notifications_per_publish=None,
    publishing_enabled=None,
)

Modify subscription parameters.

Parameters:

Name Type Description Default
publishing_interval float | None

Optional new publishing interval.

None
lifetime_count int | None

Optional new lifetime count.

None
max_keepalive_count int | None

Optional new keepalive count.

None
max_notifications_per_publish int | None

Optional maximum notifications per publish.

None
publishing_enabled bool | None

Optional publishing enabled flag.

None

Returns:

Type Description
Any

The raw result of the modify operation.