1#ifndef PROTONTHREADBASE_HXX
2#define PROTONTHREADBASE_HXX
10#include <proton/connection.hpp>
11#include <proton/function.hpp>
12#include <proton/messaging_handler.hpp>
13#include <proton/receiver.hpp>
14#include <proton/sender.hpp>
15#include <proton/transport.hpp>
16#include <proton/work_queue.hpp>
18#include "cajun/json/elements.h"
30 std::chrono::duration<long int> maximumAge,
31 std::chrono::duration<long int> retryDelay);
39 std::unique_ptr<json::Object>
getBodyAsJSON(
const proton::message &m);
48 std::chrono::duration<long int> retryDelay = std::chrono::seconds(2));
63 ProtonThreadBase(std::chrono::duration<long int> mRetryDelay = std::chrono::seconds(2));
66 void addReceiver(std::shared_ptr<ProtonReceiverBase> rx);
67 void addSender(std::shared_ptr<ProtonSenderBase> tx);
78 void on_message(proton::delivery &d, proton::message &m)
override;
82 virtual void thread()
override;
87 bool checkSenderShutdown();
90 void openReceiver(std::shared_ptr<ProtonReceiverBase> rx);
91 void openSender(std::shared_ptr<ProtonSenderBase> tx);
93 std::chrono::duration<long int> mRetryDelay;
95 std::shared_ptr<proton::container> mContainer;
96 proton::connection mConnection;
99 std::vector<std::shared_ptr<ProtonReceiverBase>> mReceivers;
100 std::vector<std::shared_ptr<ProtonSenderBase>> mSenders;
102 bool mStarted =
false;
An alternative to std::string, encapsulates an arbitrary buffer of bytes.
resip::TimeLimitFifo< proton::message > mFifo
std::chrono::duration< long int > mMaximumAge
std::chrono::duration< long int > mRetryDelay
proton::receiver mReceiver
std::unique_ptr< json::Object > getBodyAsJSON(const proton::message &m)
resip::TimeLimitFifo< proton::message > & getFifo()
proton::work_queue * mWorkQueue
virtual ~ProtonReceiverBase()
virtual ~ProtonSenderBase()
void sendMessage(const resip::Data &msg)
resip::TimeLimitFifo< Data > & getFifo()
resip::TimeLimitFifo< Data > mFifo
proton::work_queue * mWorkQueue
std::chrono::duration< long int > mRetryDelay
void on_transport_error(proton::transport &t) override
void on_sender_close(proton::sender &) override
std::shared_ptr< ProtonSenderBase > getSenderForReply(const std::string &replyTo)
void on_sender_open(proton::sender &) override
void on_receiver_close(proton::receiver &) override
void on_connection_open(proton::connection &conn) override
virtual ~ProtonThreadBase()
void addReceiver(std::shared_ptr< ProtonReceiverBase > rx)
void on_tracker_accept(proton::tracker &t) override
void on_container_start(proton::container &c) override
void on_receiver_open(proton::receiver &) override
void on_sendable(proton::sender &s) override
void addSender(std::shared_ptr< ProtonSenderBase > tx)
virtual void shutdown() override
virtual void thread() override
void on_message(proton::delivery &d, proton::message &m) override
A wrapper class to create and spawn a thread.
dcm! – add UnusedChecking(_enum) below;
unsigned long long uint64_t