clean up QAMQP::Queue api
removed noAck as it relates only to the synchronous get AMQP api moved noAck to get method applied visual separation in headers between AMQP Queue and AMQP Basic methods
This commit is contained in:
parent
fcc3d36bba
commit
e94f372cfe
|
|
@ -14,7 +14,6 @@ QueuePrivate::QueuePrivate(Queue *q)
|
||||||
: ChannelPrivate(q),
|
: ChannelPrivate(q),
|
||||||
delayedDeclare(false),
|
delayedDeclare(false),
|
||||||
declared(false),
|
declared(false),
|
||||||
noAck(true),
|
|
||||||
recievingMessage(false),
|
recievingMessage(false),
|
||||||
consuming(false)
|
consuming(false)
|
||||||
{
|
{
|
||||||
|
|
@ -296,18 +295,6 @@ int Queue::options() const
|
||||||
return d->options;
|
return d->options;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Queue::setNoAck(bool noAck)
|
|
||||||
{
|
|
||||||
Q_D(Queue);
|
|
||||||
d->noAck = noAck;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool Queue::noAck() const
|
|
||||||
{
|
|
||||||
Q_D(const Queue);
|
|
||||||
return d->noAck;
|
|
||||||
}
|
|
||||||
|
|
||||||
void Queue::declare(int options)
|
void Queue::declare(int options)
|
||||||
{
|
{
|
||||||
Q_D(Queue);
|
Q_D(Queue);
|
||||||
|
|
@ -481,11 +468,11 @@ bool Queue::isConsuming() const
|
||||||
return d->consuming;
|
return d->consuming;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Queue::get()
|
void Queue::get(bool noAck)
|
||||||
{
|
{
|
||||||
Q_D(Queue);
|
Q_D(Queue);
|
||||||
if (!d->opened) {
|
if (!d->opened) {
|
||||||
qAmqpDebug() << Q_FUNC_INFO << "queue is not open";
|
qAmqpDebug() << Q_FUNC_INFO << "channel is not open";
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -498,7 +485,7 @@ void Queue::get()
|
||||||
out << qint16(0); //reserved 1
|
out << qint16(0); //reserved 1
|
||||||
Frame::writeField('s', out, d->name);
|
Frame::writeField('s', out, d->name);
|
||||||
|
|
||||||
out << qint8(d->noAck ? 1 : 0); // noAck
|
out << qint8(noAck ? 1 : 0); // noAck
|
||||||
|
|
||||||
frame.setArguments(arguments);
|
frame.setArguments(arguments);
|
||||||
d->sendFrame(frame);
|
d->sendFrame(frame);
|
||||||
|
|
@ -508,7 +495,7 @@ void Queue::ack(const Message &message)
|
||||||
{
|
{
|
||||||
Q_D(Queue);
|
Q_D(Queue);
|
||||||
if (!d->opened) {
|
if (!d->opened) {
|
||||||
qAmqpDebug() << Q_FUNC_INFO << "queue is not open";
|
qAmqpDebug() << Q_FUNC_INFO << "channel is not open";
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -20,7 +20,6 @@ class QAMQP_EXPORT Queue : public Channel, public QQueue<Message>
|
||||||
Q_ENUMS(QueueOptions)
|
Q_ENUMS(QueueOptions)
|
||||||
Q_PROPERTY(int options READ options CONSTANT)
|
Q_PROPERTY(int options READ options CONSTANT)
|
||||||
Q_PROPERTY(QString consumerTag READ consumerTag WRITE setConsumerTag)
|
Q_PROPERTY(QString consumerTag READ consumerTag WRITE setConsumerTag)
|
||||||
Q_PROPERTY(bool noAck READ noAck WRITE setNoAck)
|
|
||||||
Q_ENUMS(QueueOption)
|
Q_ENUMS(QueueOption)
|
||||||
Q_ENUMS(ConsumeOption)
|
Q_ENUMS(ConsumeOption)
|
||||||
Q_ENUMS(RemoveOption)
|
Q_ENUMS(RemoveOption)
|
||||||
|
|
@ -56,13 +55,9 @@ public:
|
||||||
~Queue();
|
~Queue();
|
||||||
|
|
||||||
bool isConsuming() const;
|
bool isConsuming() const;
|
||||||
|
|
||||||
void setConsumerTag(const QString &consumerTag);
|
void setConsumerTag(const QString &consumerTag);
|
||||||
QString consumerTag() const;
|
QString consumerTag() const;
|
||||||
|
|
||||||
void setNoAck(bool noAck);
|
|
||||||
bool noAck() const;
|
|
||||||
|
|
||||||
// AMQP Queue
|
// AMQP Queue
|
||||||
void declare(int options = Durable|AutoDelete);
|
void declare(int options = Durable|AutoDelete);
|
||||||
void bind(const QString &exchangeName, const QString &key);
|
void bind(const QString &exchangeName, const QString &key);
|
||||||
|
|
@ -74,7 +69,7 @@ public:
|
||||||
|
|
||||||
// AMQP Basic
|
// AMQP Basic
|
||||||
bool consume(int options = NoOptions);
|
bool consume(int options = NoOptions);
|
||||||
void get();
|
void get(bool noAck = true);
|
||||||
void ack(const Message &message);
|
void ack(const Message &message);
|
||||||
bool cancel(bool noWait = false);
|
bool cancel(bool noWait = false);
|
||||||
|
|
||||||
|
|
@ -83,9 +78,10 @@ Q_SIGNALS:
|
||||||
void bound();
|
void bound();
|
||||||
void unbound();
|
void unbound();
|
||||||
void removed();
|
void removed();
|
||||||
|
void purged(int messageCount);
|
||||||
|
|
||||||
void messageReceived();
|
void messageReceived();
|
||||||
void empty();
|
void empty();
|
||||||
void purged(int messageCount);
|
|
||||||
void consuming(const QString &consumerTag);
|
void consuming(const QString &consumerTag);
|
||||||
void cancelled(const QString &consumerTag);
|
void cancelled(const QString &consumerTag);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -47,9 +47,9 @@ public:
|
||||||
int options;
|
int options;
|
||||||
bool delayedDeclare;
|
bool delayedDeclare;
|
||||||
bool declared;
|
bool declared;
|
||||||
bool noAck;
|
|
||||||
QString consumerTag;
|
|
||||||
QQueue<QPair<QString, QString> > delayedBindings;
|
QQueue<QPair<QString, QString> > delayedBindings;
|
||||||
|
|
||||||
|
QString consumerTag;
|
||||||
bool recievingMessage;
|
bool recievingMessage;
|
||||||
Message currentMessage;
|
Message currentMessage;
|
||||||
bool consuming;
|
bool consuming;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue