mirror of
https://github.com/aurora-opensource/xviz.git
synced 2026-02-01 14:36:33 +00:00
Follow the convention that constant enumerated values should be in ALLCAPS. This is a spec change for XVIZ, but retains compatibility with lowercase by forcing a case conversion at the appropriate places within the modules.
Spec change locations:
declarative ui properties
- component type
- layout
- interactions
xviz message
- type
- xviz/start
- session_type
- message_format
- log
- xviz/metadata
- stream metadata
- category
- scalar type, for time_series & variables
- primitive type, for time_series & variables
- annotation_type, for annotations
- stream style
- text_anchor
- text_baseline
- xviz/state_update
- update_type
- xviz/reconfigure
- update_type
1.4 KiB
1.4 KiB
XVIZWebSocketSender
XVIZWebSocketSender is a middleware component that will send the XVIZ message through a websocket.
It will ensure that the data is properly formatted for sending over a websocket and convert the data if necessary.
Example
// In the context of an XVIZSession class
this.middleware = new XVIZServerMiddlewareStack();
const stack = [
new XVIZProviderRequestHandler(this.context, this.provider, this.middleware, this.options),
new XVIZWebsocketSender(this.context, this.socket, this.options)
];
this.middleware.set(stack);
Constructor
XVIZWebSocketSender(context, socket, options)
Parameters:
context(XVIZSessionContext) - Shared session context to store datasocket(Object) - Websocket for the sessionoptions(Object) - options objectcompress(Boolean) - Choice to apply perMessageDeflate if the message wire format is TEXTformat(XVIZ_FORMAT) - Format of the XVIZ data to send to the clientlogger(Object) - Logger object passed through the systemlog(Function) - Function that will always display the messageerror(Function) - Function for error level messageswarn(Function) - Function for warning level messagesinfo(Function) - Function for info level messagesverbose(Function) - Function for verbose level messages