Skip to content

About future and promise in StateClient #25

Answered by langroodi
Emanonvvv asked this question in Q&A
Discussion options

You must be logged in to vote

The responsibility is at the callee (StateClient) side and not the caller (SM) side (if you are thinking about which responsibility, then read my previous response again). That is why mSetStateFuture is private and that is why I said previously:

Then, better to put SM outside of this equation to avoid any confusion for now.

Besides that, the idea of that:

mSetStateFuture.valid() should be false

is not correct because if the future is valid, it means the StateClient should first cancel the previous request and inform this cancellation to the callers. And then it should process the new state. Invalid mSetStateFuture means nobody called SetState. So, after the first call, mSetStateFuture

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@langroodi
Comment options

Answer selected by Emanonvvv
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants