Loading...
Searching...
No Matches
ServerSentEventClient::ServerSentEventClientDataProvider Class Reference

Event-based data provider for ServerSentEvent messaging. More...

`#include <ServerSentEventClientDataProvider.qc.dox.h>`

Inheritance diagram for ServerSentEventClient::ServerSentEventClientDataProvider:
[legend]

## Public Member Functions

| constructor (*hash< auto > options)
| Creates the object from constructor options.
| constructor (hash< auto > template_options, *hash< auto > options)
| Creates the object from constructor + template options.
Public Member Functions inherited from ServerSentEventClient::ServerSentEventClientDataProviderBase
| constructor (*hash< auto > options)
| Creates the object from constructor options.
| deregister ()
| Dergister a child data provider.
bool | deregisterObserver (object observer)
| The method deregisters the given observer.
Queue | getQueue ()
| Returs the child message queue.
bool | isConnected ()
| Returns True if the object is currently connected.
| observersReady ()
| Called when all observers have been added to the object.
| reconnect ()
| Initiate a reconnect action on the client.
| register (ServerSentEventClientWaitForMessageDataProvider child)
| Regstiger a child data provider.
| registerObserver (object observer,...)
| The method registers the given observer.
| setLogger (*LoggerInterface logger)
| Accepts a LoggerInterface object for logging (or clears it)

## Public Attributes

const | ExampleTimeout = 10s
| Max time to wait for example data.
const | ProviderInfo = ...
| Provider info.
Public Attributes inherited from ServerSentEventClient::ServerSentEventClientDataProviderBase
const | ApiClasses = ...
| Registered API classes.
const | ConstructorOptions = ...
| Constructor options.
const | ProviderInfo = ...
| Provider info.
const | RequiredConstructorOptions = "url|sseclient"
| Required constructor option combinations.

## Protected Member Functions

auto | getExampleEventDataImpl (string event_id)
| Returns example data for the given observable event.
Protected Member Functions inherited from ServerSentEventClient::ServerSentEventClientDataProviderBase
*AbstractDataProvider | getChildProviderImpl (string name)
| Returns the given child provider or nothing if the given child is unknown.
*list< string > | getChildProviderNamesImpl ()
| Returns a list of child data provider names.
*hash< DataProviderConnectionInfo > | getConnectionInfoImpl ()
| Returns connection info.
hash< string, hash< DataProviderMessageInfo > > | getEventTypesImpl ()
| Returns a hash of all supported event types.
Mutex | m ()
| Mutex for wait for message child data provider handling.

## Additional Inherited Members

Static Public Member Functions inherited from ServerSentEventClient::ServerSentEventClientDataProviderBase
static hash< auto > | getOptionsFromTemplate (hash< auto > template_options, *hash< auto > options)
| Returns options from a template.
Protected Attributes inherited from ServerSentEventClient::ServerSentEventClientDataProviderBase
ServerSentEventClientWaitForMessageDataProvider | child
| Wait for message API data provider.
ServerSentEventClient | client
| The SSE client itself.
QueuedObserver | queued_observer
| Queued observer.

## Detailed Description

Event-based data provider for ServerSentEvent messaging.

The event ID raised for ServerSentEvent data events is `"sse-data-event"` (see EVENT_SSE_DATA), and, when the connection is closed, a `"sse-closed-event"` (see EVENT_SSE_CLOSED) is raised.

## Member Function Documentation

## getExampleEventDataImpl()

auto ServerSentEventClient::ServerSentEventClientDataProvider::getExampleEventDataImpl | ( | string | event_id | ) |

protected

Returns example data for the given observable event.

Parameters

  event_id | the event ID of the event

Returns
  example data for the given observable event

Exceptions

  INVALID-OPERATION | the data provider does not support the observer pattern / event API
  INVALID-EVENT | the event_id is not valid

Since
  DataProvider 3.0