Nah, what you want is a higher level protocol which allows you to bundle messages into a named sequence which you can then commit.
The server can then "buffer" the sequence until it's (a) contiguous (b) matches the rules of the start of sequence message (c) gets the end sequence/commit message ...
The end sequence or start sequence would contain the "bundling" rules for any of the messages that return data, and send back a single response composed of the results bundle.
If it returns "incomplete sequence, missing x", the protocol would resend x, and try to close the sequence again. Repeat until all sequence rules are met or until an action raises a fatal error which forces the abandoning of the sequence. This process of course would be hidden from the coder.
into a named sequence which you can then commit.
The server can then "buffer" the sequence until it's (a) contiguous (b) matches
the rules of the start of sequence message (c) gets the end sequence/commit message
...
The end sequence or start sequence would contain the "bundling" rules for any of the messages that return data, and send back a single response composed of the results bundle.
If it returns "incomplete sequence, missing x", the protocol would resend x, and
try to close the sequence again. Repeat until all sequence rules are met or until an action raises a fatal error which forces the abandoning of the sequence. This process of course would be hidden from the coder.