before invoking OnMessageReceived events, Comms should give users the possibility of performing some multi-threaded parsing/decoding.
The goal here is to avoid a 1-2 frame delay for each message that needs to be parsed or decoded in a separate thread.
For example,
if Comms receives a JPG, it then sends it to the main thread during an update call. The update call would then invoke a function that decodes the jpeg in a separate thread. The raw image would only come back to the main thread on the next update call. This guarantees a one frame cost for each frame received.
By allowing users to include custom processing in the socket thread (or in a separate thread), we can receive and decode messages (e.g., JPGs) before calling update with the final result.
before invoking OnMessageReceived events, Comms should give users the possibility of performing some multi-threaded parsing/decoding.
The goal here is to avoid a 1-2 frame delay for each message that needs to be parsed or decoded in a separate thread.
For example,
if Comms receives a JPG, it then sends it to the main thread during an update call. The update call would then invoke a function that decodes the jpeg in a separate thread. The raw image would only come back to the main thread on the next update call. This guarantees a one frame cost for each frame received.
By allowing users to include custom processing in the socket thread (or in a separate thread), we can receive and decode messages (e.g., JPGs) before calling update with the final result.