You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This patch wraps the dynamic subscription functions. We add a new
handle for the subscription that contains the file descriptor where
clients are supposed to send the notifications.
We tried to reuse the current Subscription class for dynamic
subscriptions as well and not let sysrepo create its own internal
background threads. However, subscribing to yang push periodic timer
creates a new thread in sysrepo anyway, so completely decoupling from
the C API would be much work.
This patch does not yet wrap the functions for modifying subscriptions.
The new DynamicSubscription class implements pimpl idiom. The class is
movable. When the subscription is moved, the destructor is called on
the old object. However, the destructor is supposed to close the file
descriptor. We need to make sure that the file descriptor is not closed
twice.
I was thinking about using std::unique_ptr to manage the file descriptor
or by setting the fd to something "invalid" after the move. I found the
former solution more elegant.
Maybe we should refactor the Subscription class to use pimpl idiom as
well.
Depends-on: https://gerrit.cesnet.cz/c/CzechLight/libyang-cpp/+/8149
Change-Id: I1cee5e730fcc762b2e0a58d3d5c40bf358504397
0 commit comments