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
I've been trying to use bond as an alternative to a custom heartbeat solution we've been using in our ROS stack, and I'm having trouble getting the onFormedCallback to trigger consistently. I'm unsure if this is unintended behaviour, or if I'm misunderstanding the intent of the Formed state.
My (possibly incorrect) understanding is that a Bond enters the Formed state when both sides of the connection have been created and started e.g, my expected behaviour (it's kind of pseudo-codey and for simplicity each line is ordered by time).
<node-1> bond::Bond bond(<params>)
<node-1> bond.setOnFormed([](){ std::cout << "Hello 1" << std::endl; });
<node-1> bond.start()
<node-2> bond::Bond bond(<params>)
<node-2> bond.setOnFormed([](){ std::cout << "Hello 2 << std::endl; });
<node-2> bond.start();
<node-1> prints "Hello 1" (ordering here not necessarily important)
<node-2> prints "Hello 2" (ordering here not necessarily important)
The actual behaviour is that sometimes the callbacks trigger and sometimes they don't, and I'm a little confused as to when a bond enters the Formed state:
<node-1> bond::Bond bond(<params>)
<node-1> bond.setOnFormed([](){ std::cout << "Hello 1" << std::endl; });
<node-1> bond.start()
# Is `Formed` tied to instantiation of the bond, or starting of the bond?
# Additionally, could this bond already be in the `Formed` state, since its sister is already set up?
# i.e. `setOnFormed` is already to late to trigger
<node-2> bond::Bond bond(<params>)
<node-2> bond.setOnFormed([](){ std::cout << "Hello 2 << std::endl; });
# If tied to starting, are both bonds `Formed` after both ends are started
# or is each bond formed only when its sister is started?
# i.e. timing of starts is important
<node-2> bond.start();
<node-1> prints "Hello 1" (ordering here not necessarily important)
<node-2> prints "Hello 2" (ordering here not necessarily important)
I'm wondering if the actual behaviour is that only one side of the bond needs to start for the other side to register as formed? If my original assumption is correct, I can provide a more detailed example.
The text was updated successfully, but these errors were encountered:
I've been trying to use bond as an alternative to a custom heartbeat solution we've been using in our ROS stack, and I'm having trouble getting the
onFormedCallback
to trigger consistently. I'm unsure if this is unintended behaviour, or if I'm misunderstanding the intent of theFormed
state.My (possibly incorrect) understanding is that a Bond enters the
Formed
state when both sides of the connection have been created and started e.g, my expected behaviour (it's kind of pseudo-codey and for simplicity each line is ordered by time).The actual behaviour is that sometimes the callbacks trigger and sometimes they don't, and I'm a little confused as to when a bond enters the
Formed
state:I'm wondering if the actual behaviour is that only one side of the bond needs to start for the other side to register as formed? If my original assumption is correct, I can provide a more detailed example.
The text was updated successfully, but these errors were encountered: