From 79fe85cc0b3fafbedc9a72e65ef4e08140762bd8 Mon Sep 17 00:00:00 2001 From: Emiel Bruijntjes Date: Sat, 18 Apr 2020 08:30:44 +0200 Subject: [PATCH] added Channel::ready() method --- include/amqpcpp/channel.h | 9 +++++++++ include/amqpcpp/channelimpl.h | 9 +++++++++ 2 files changed, 18 insertions(+) diff --git a/include/amqpcpp/channel.h b/include/amqpcpp/channel.h index ca2814c..b1c197b 100644 --- a/include/amqpcpp/channel.h +++ b/include/amqpcpp/channel.h @@ -124,6 +124,15 @@ public: return _implementation->resume(); } + /** + * Is the channel ready / has it passed the initial handshake? + * @return bool + */ + bool ready() const + { + return _implementation->ready(); + } + /** * Is the channel usable / not yet closed? * @return bool diff --git a/include/amqpcpp/channelimpl.h b/include/amqpcpp/channelimpl.h index da0c07c..edc08e2 100644 --- a/include/amqpcpp/channelimpl.h +++ b/include/amqpcpp/channelimpl.h @@ -260,6 +260,15 @@ public: return _state == state_connected || _state == state_ready; } + /** + * Is the channel ready / has it passed the initial handshake? + * @return bool + */ + bool ready() const + { + return _state == state_ready; + } + /** * Put channel in a confirm mode (RabbitMQ specific) */