Open cavemanpi opened 10 years ago
Decision should be made as to if the decoding of the envelope should be done by the websocket message handler, or if it should be passed off to the rpc handler, which can then handle any needed special action.
Handling it in the websocket has the advantage of it helps ensure that a client sending very large messages doesn't send another message that will complete processing before the first message has been processed, and more closely resembles the current system layout. It has the disadvantage of slowing down the messaging rate, since a decode phase is required before further messages can be transmitted to the client, which we currently avoid by special casing message types, and only handling decode in an async rpc process, in the event that special action is required.
With the growing number of different available message semantics (Broadcast, system messages, control messages), special casing a small subset of messages to have different behavior is no longer sustainable for further progress. A proper system should be put in place to handle transmitting messages inside envelopes which contain metadata pertaining to the message, including but not limited to: The scope of the message, the type of message.