WebSocket client
WebSocket client is defined by WebSocket interface. It looks like this:
Basically, it has two main functionalities: sending a message and subscribing to the responses (and/or errors).
And here is how WebSocket client itself looks like:
When creating the client we set the whether it should be secure or not (if secure, uses wss); its host, path, parameters, port. The last property is the policy that should be applied to the client.
It's defined like this:
The policy can be one of the following three types:
NONE - No future subscriber recieves the pending data
FIRST_SUBSCRIBER - Only the first subscriber recieves pending data
ALL_SUBSCRIBERS - All subscribers recieve pending data
The default policy is set to NONE
.
Last updated