5 #include <Poco/Event.h>
6 #include <Poco/Mutex.h>
7 #include <Poco/Timespan.h>
9 #include "core/QueuingExporter.h"
10 #include "loop/StoppableRunnable.h"
11 #include "loop/StopControl.h"
12 #include "server/GWSConnector.h"
13 #include "server/GWSListener.h"
35 typedef Poco::SharedPtr<GWSQueuingExporter> Ptr;
73 void onOther(
const GWMessage::Ptr message)
override;
80 Poco::Timespan m_acquireTimeout;
81 Poco::Timespan m_sendFailedDelay;
82 GWSConnector::Ptr m_connector;
85 std::set<GlobalID> m_acked;
86 Poco::FastMutex m_ackedLock;
GWSQueuingExporter implements stop-and-go exporting logic based on the QueuingExporter. The GWSQueuingExporter is to be explicitly registered as a GWSListener to a selected GWSConnector instance. The same GWSConnector instance should then be used for sending of messages.
Definition: GWSQueuingExporter.h:30
void onOther(const GWMessage::Ptr message) override
Receive GWSensorDataConfirm messages via this method.
Definition: GWSQueuingExporter.cpp:139
void setConnector(GWSConnector::Ptr connector)
Configure GWSConnector instance to send data through.
Definition: GWSQueuingExporter.cpp:57
void setAcquireTimeout(const Poco::Timespan &timeout)
Configure how long to wait until the QueuingExporter::acquire() operation returns a result...
Definition: GWSQueuingExporter.cpp:41
Implements Exporter interface and provides SensorData prevents SensorData loss.
Definition: QueuingExporter.h:45
void setActiveCount(int count)
Configure how many SensorData instances to acquire while exporting data, i.e. it denotes a batch size...
Definition: GWSQueuingExporter.cpp:33
StopControl implements the stop mechanism generically.
Definition: StopControl.h:12
Definition: GWSListener.h:23
void setSendFailedDelay(const Poco::Timespan &delay)
Configure delay for the next send attempt, if the current send() fails.
Definition: GWSQueuingExporter.cpp:49
void onConnected(const Address &address) override
Wake-up failed sending when it seems that the connection is up again.
Definition: GWSQueuingExporter.cpp:134
void stop() override
Definition: GWSQueuingExporter.cpp:128
Definition: StoppableRunnable.h:8
GWSListener provides an interface for delivering of events and messages related to communication with...
Definition: GWSListener.h:19