Qore ServerSentEventClient Module Reference 1.0
Loading...
Searching...
No Matches
ServerSentEventClientDataProviderBase.qc.dox.h
1// -*- mode: c++; indent-tabs-mode: nil -*-
3
4/* ServerSentEventClientDataProviderBase.qc Copyright 2025 Qore Technologies, s.r.o.
5
6 Permission is hereby granted, free of charge, to any person obtaining a
7 copy of this software and associated documentation files (the "Software"),
8 to deal in the Software without restriction, including without limitation
9 the rights to use, copy, modify, merge, publish, distribute, sublicense,
10 and/or sell copies of the Software, and to permit persons to whom the
11 Software is furnished to do so, subject to the following conditions:
12
13 The above copyright notice and this permission notice shall be included in
14 all copies or substantial portions of the Software.
15
16 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21 FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
22 DEALINGS IN THE SOFTWARE.
23*/
24
26namespace ServerSentEventClient {
28
30class ServerSentEventClientDataProviderBase : public DataProvider::AbstractDataProvider {
31
32public:
34 const ProviderInfo = ...;
35
36
38 const ConstructorOptions = ...;
39
40
42 const RequiredConstructorOptions = "url|sseclient";
43
45 const ApiClasses = ...;
46
47
48protected:
51
53 Mutex m();
54
57
59 QueuedObserver queued_observer;
60
61public:
62
64 constructor(*hash<auto> options);
65
66
67 destructor();
68
69
70 string getName();
71
72
74 setLogger(*LoggerInterface logger);
75
76
79
80
83
84
86 Queue getQueue();
87
88
90 registerObserver(object observer, ...);
91
92
94
98 bool deregisterObserver(object observer);
99
100
102
105
106
109
110
113
114
116
121protected:
122 *hash<DataProviderConnectionInfo> getConnectionInfoImpl();
123public:
124
125
127
129protected:
131public:
132
133
135
141protected:
142 *AbstractDataProvider getChildProviderImpl(string name);
143public:
144
145
147
151protected:
152 hash<string, hash<DataProviderMessageInfo>> getEventTypesImpl();
153public:
154
155
157 static hash<auto> getOptionsFromTemplate(hash<auto> template_options, *hash<auto> options);
158};
159};
Event-based data provider for ServerSentEvent client-side events.
Definition ServerSentEventClientDataProviderBase.qc.dox.h:30
static hash< auto > getOptionsFromTemplate(hash< auto > template_options, *hash< auto > options)
Returns options from a template.
const RequiredConstructorOptions
Required constructor option combinations.
Definition ServerSentEventClientDataProviderBase.qc.dox.h:42
setLogger(*LoggerInterface logger)
Accepts a LoggerInterface object for logging (or clears it)
const ApiClasses
Registered API classes.
Definition ServerSentEventClientDataProviderBase.qc.dox.h:45
const ConstructorOptions
Constructor options.
Definition ServerSentEventClientDataProviderBase.qc.dox.h:38
hash< string, hash< DataProviderMessageInfo > > getEventTypesImpl()
Returns a hash of all supported event types.
QueuedObserver queued_observer
Queued observer.
Definition ServerSentEventClientDataProviderBase.qc.dox.h:59
*hash< DataProviderConnectionInfo > getConnectionInfoImpl()
Returns connection info.
observersReady()
Called when all observers have been added to the object.
ServerSentEventClientWaitForMessageDataProvider child
Wait for message API data provider.
Definition ServerSentEventClientDataProviderBase.qc.dox.h:56
bool deregisterObserver(object observer)
The method deregisters the given observer.
registerObserver(object observer,...)
The method registers the given observer.
bool isConnected()
Returns True if the object is currently connected.
Mutex m()
Mutex for wait for message child data provider handling.
const ProviderInfo
Provider info.
Definition ServerSentEventClientDataProviderBase.qc.dox.h:34
*list< string > getChildProviderNamesImpl()
Returns a list of child data provider names.
*AbstractDataProvider getChildProviderImpl(string name)
Returns the given child provider or nothing if the given child is unknown.
ServerSentEventClient client
The SSE client itself.
Definition ServerSentEventClientDataProviderBase.qc.dox.h:50
constructor(*hash< auto > options)
Creates the object from constructor options.
Queue getQueue()
Returs the child message queue.
reconnect()
Initiate a reconnect action on the client.
ServerSentEvent client wait for message from server API data provider.
Definition ServerSentEventClientWaitForMessageDataProvider.qc.dox.h:28
the ServerSentEventClient namespace contains all the definitions in the ServerSentEventClient module
Definition ServerSentEventClient.qc.dox.h:26