Conversation
|
We probably only need to merge this or #7839, but not both. This approach makes stronger guarantees about synchronicity of message processing. |
|
I think this is better than #7839 for the following reasons:
A message handler doesn't have to be synchronous, of course. If it doesn't return a promise, we won't wait for it. This just makes the default to wait for handling before trying to handle more messages. |
|
After a day of thinking about it, I'm inclined to agree. @jdfreder this PR is smaller than it looks, since ~half of it is actually #7780. The actual changes are here. It's mostly adding returns statements. |
61a1456 to
dcd10fa
Compare
|
Since 7780 was merged, this is probably the best solution. |
|
@jasongrout Can you rebase this one now that #7780 is merged so this accurately represents the diff? |
A problem can happen when two messages come in for different comms, where the second depends on the first (for example, the first might be a message setting the state of a widget, and the second triggering a view creation for the widget). Since comm message queues are independent of each other, the second message could be executed before the first message. This exposes a more fundamental assumption users are likely to have that messages from python are processed synchronously. Thanks to @dmadeka for reporting an error that led to discovering this issue.
dcd10fa to
f936f88
Compare
|
@minrk: rebased. |
|
@jasongrout thanks! |
Keep kernel messages synchronous promises all the way down
A problem can happen when two messages come in for different
comms, where the second depends on the first (for example, the
first might be a message setting the state of a widget, and the
second triggering a view creation for the widget). Since comm
message queues are independent of each other, the second message
could be executed before the first message.
This exposes a more fundamental assumption users are likely to
have that messages from python are processed synchronously.
This includes #7780.