Skip to content

chore(opcua): cleanup client lifetime semantics #549

Description

@cartercanedy

The open62541::AsyncClient::shutdown method takes itself by move. Implementing Drop for OpcUaClient, by extension, can't work, since we're only obtaining access to a mutable reference to self. Since we return Arc<Self> from the constructor, both OpcUaClient::start_polling and OpcUaClient::start_subscription both depend on taking weak references to an Arc<Self>. This makes cleanup semantics weird and unclear. While we can implement an internal synchronization of background stream sessions in Drop, the ideal scenario is no synchronization at all, and allowing the background workers to terminate independent of the open62541 client connection.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingenhancementNew feature or request

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions