Current Behavior
Netflux sends messages only as ArrayBuffer. DataView API is used to construct the ArrayBuffer with help of Encoding and JSON APIs. All services' messages are sent as an encoded string and only the message header (3 fields: message type, sender peer id and receiver peer id) are binaries.
Expected Behavior
Serialize/deserialize messages with Protocol Buffer. Use proto files for almost all internal messages, instead of string.
What is the motivation / use case for changing the behavior?
Improve code maintainability. Decrease the size of messages circulating over the network, thus improve performance.
Tips
Protocol Buffer is a specification created by Google. Two its major implementations for Javascript exist as for now:
Current Behavior Netflux sends messages only as ArrayBuffer. DataView API is used to construct the ArrayBuffer with help of Encoding and JSON APIs. All services' messages are sent as an encoded string and only the message header (3 fields: message type, sender peer id and receiver peer id) are binaries.
Expected Behavior Serialize/deserialize messages with Protocol Buffer. Use proto files for almost all internal messages, instead of string.
What is the motivation / use case for changing the behavior? Improve code maintainability. Decrease the size of messages circulating over the network, thus improve performance.
Tips Protocol Buffer is a specification created by Google. Two its major implementations for Javascript exist as for now: