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
One aspect I really like about the up-cpp uP-L1 Transport API is that they have a concept of a Connection which gives them a nice API where even if they do not unregister_listener, the holder of the other end of the Connection can drop it in order to make the transport unable to call it anymore.
I think we could do the same in Rust by passing in a std::sync::Weak<dyn UListener> such that if the entity which is orchestrating the the UTransport wanted it to no longer be able to call it and in fact deregister, it would be possible to know that when the implementation attempted to call Weak::upgrade().
Just something going through my mind as I looked at how I implemented UTransport to take an Arc<dyn UListener> a while ago.
The text was updated successfully, but these errors were encountered:
One aspect I really like about the
up-cpp
uP-L1 Transport API is that they have a concept of aConnection
which gives them a nice API where even if they do notunregister_listener
, the holder of the other end of theConnection
can drop it in order to make the transport unable to call it anymore.I think we could do the same in Rust by passing in a
std::sync::Weak<dyn UListener>
such that if the entity which is orchestrating the theUTransport
wanted it to no longer be able to call it and in fact deregister, it would be possible to know that when the implementation attempted to callWeak::upgrade()
.Just something going through my mind as I looked at how I implemented
UTransport
to take anArc<dyn UListener>
a while ago.The text was updated successfully, but these errors were encountered: