Qore WebSocketClient Module Reference 2.2
Loading...
Searching...
No Matches
WebSocketClient::WebSocketClientDataProviderBase Class Referenceabstract

Event- and message-based data provider for WebSocket client-side events. More...

#include <WebSocketClient.qm.dox.h>

Inheritance diagram for WebSocketClient::WebSocketClientDataProviderBase:
[legend]

Public Member Methods

 constructor (*hash< auto > options)
 Creates the object from constructor options.
 
 deregister ()
 Dergister a child data provider.
 
auto deserializeMessage (data msg)
 Deserializes the message.
 
Queue getQueue ()
 Returs the child message queue.
 
abstract notifyObservers (string msg_id, hash< auto > event)
 For WS event notifications.
 
 register (WebSocketClientWaitForMessageDataProvider child)
 Regstiger a child data provider.
 
data serializeMessage (auto msg)
 Serializes the message for sending.
 

Static Public Member Methods

static hash< auto > getOptionsFromTemplate (hash< auto > template_options, *hash< auto > options)
 Returns options from a template.
 

Public Attributes

const ApiClasses
 Registered API classes.
 
const ConstructorOptions
 Constructor options.
 
const ProviderInfo
 Provider info.
 
const SerializationMap = ...
 Set of serialization options as a hash.
 

Private Member Methods

 event (*data msg)
 Called when a WebSocket event arrives.
 
*AbstractDataProvider getChildProviderImpl (string name)
 Returns the given child provider or NOTHING if the given child is unknown. More...
 
*list< string > getChildProviderNamesImpl ()
 Returns a list of child data provider names. More...
 
hash< string, hash< DataProviderMessageInfo > > getEventTypesImpl ()
 Returns a hash of all supported event types. More...
 
hash< string, hash< DataProviderMessageInfo > > getMessageTypesImpl ()
 Returns the description of an outbound message, if any. More...
 
Mutex m ()
 Mutex for wait for message child data provider handling.
 
 pong (*data msg)
 Got a pong message.
 
 sendMessageImpl (string message_id, auto msg, *hash< auto > send_message_options)
 Sends a message from message-capable data providers. More...
 
 start ()
 Connects and starts receiving messages.
 
 unsupportedSerialization ()
 Throws an UNSUPPORTED-SERIALIZATION error.
 

Private Attributes

WebSocketClientWaitForMessageDataProvider child
 Wait for message API data provider.
 
WebSocketClient client
 The web socket client itself.
 
Queue q
 Child message queue.
 
bool report_pings
 report pings
 
string serialization
 Data serialization.
 

Detailed Description

Event- and message-based data provider for WebSocket client-side events.

Member Function Documentation

◆ getChildProviderImpl()

*AbstractDataProvider WebSocketClient::WebSocketClientDataProviderBase::getChildProviderImpl ( string  name)
private

Returns the given child provider or NOTHING if the given child is unknown.

Returns
the given child provider or NOTHING if the given child is unknown
Exceptions
CHILD-PROVIDER-ERRORerror acquiring child provider
See also
getChildProviderEx()

◆ getChildProviderNamesImpl()

*list< string > WebSocketClient::WebSocketClientDataProviderBase::getChildProviderNamesImpl ( )
private

Returns a list of child data provider names.

Returns
a list of child data provider names

◆ getEventTypesImpl()

hash< string, hash< DataProviderMessageInfo > > WebSocketClient::WebSocketClientDataProviderBase::getEventTypesImpl ( )
private

Returns a hash of all supported event types.

Returns
a hash of all supported event types
Note
only called if the provider supports the observer pattern / event API

◆ getMessageTypesImpl()

hash< string, hash< DataProviderMessageInfo > > WebSocketClient::WebSocketClientDataProviderBase::getMessageTypesImpl ( )
private

Returns the description of an outbound message, if any.

Returns
the message type for this provider
Note
only called if the provider supports sending messages

◆ sendMessageImpl()

WebSocketClient::WebSocketClientDataProviderBase::sendMessageImpl ( string  message_id,
auto  msg,
*hash< auto >  send_message_options 
)
private

Sends a message from message-capable data providers.

Parameters
msgthe message to send
send_message_optionsthe options for sending the message