Calling caf::disposable::dispose causes the monitor callback function to block indefinitely #1977
Unanswered
phil-skillwon
asked this question in
Q&A
Replies: 1 comment 1 reply
-
|
@phil-skillwon sorry for the late response, this got probably buried since it has been opened in the holiday season. The disposable points to the action itself that runs the callback to |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
May I ask a question about using the new version of the
monitormember function? In my code, I’m storing thecaf::disposablehandle returned bymonitoras a member variable inside the actor (e.g.caf::disposable m_dispHandle). I’ve written a callback function that capturesthisso it can accessm_dispHandleinside the callback, and then it callsm_dispHandle.dispose(). However, I’m noticing that the entire program blocks at that point and the callback never returns.Does this mean I shouldn’t call
caf::disposable::disposefrom inside the callback?Below is roughly what my C++ code looks like:
The CAF documentation for
disposesays:My understanding is that calling this member function should be safe whether the monitored actor is still alive or not. So is it incorrect to access the disposable handle from within the callback? Or am I missing something here?
Beta Was this translation helpful? Give feedback.
All reactions