merge Queue::purge and QueuePrivate::purge
This commit is contained in:
parent
c6d0c57d5f
commit
e5e3036d03
|
|
@ -82,7 +82,23 @@ void Queue::remove(bool ifUnused, bool ifEmpty, bool noWait)
|
||||||
void Queue::purge()
|
void Queue::purge()
|
||||||
{
|
{
|
||||||
Q_D(Queue);
|
Q_D(Queue);
|
||||||
d->purge();
|
|
||||||
|
if (!d->opened)
|
||||||
|
return;
|
||||||
|
|
||||||
|
Frame::Method frame(Frame::fcQueue, QueuePrivate::miPurge);
|
||||||
|
frame.setChannel(d->number);
|
||||||
|
|
||||||
|
QByteArray arguments;
|
||||||
|
QDataStream out(&arguments, QIODevice::WriteOnly);
|
||||||
|
|
||||||
|
out << qint16(0); //reserver 1
|
||||||
|
Frame::writeField('s', out, d->name);
|
||||||
|
|
||||||
|
out << qint8(0); // no-wait
|
||||||
|
frame.setArguments(arguments);
|
||||||
|
|
||||||
|
d->sendFrame(frame);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Queue::bind(const QString &exchangeName, const QString &key)
|
void Queue::bind(const QString &exchangeName, const QString &key)
|
||||||
|
|
@ -333,22 +349,6 @@ void QueuePrivate::remove(bool ifUnused, bool ifEmpty, bool noWait)
|
||||||
sendFrame(frame);
|
sendFrame(frame);
|
||||||
}
|
}
|
||||||
|
|
||||||
void QueuePrivate::purge()
|
|
||||||
{
|
|
||||||
if (!opened)
|
|
||||||
return;
|
|
||||||
|
|
||||||
Frame::Method frame(Frame::fcQueue, miPurge);
|
|
||||||
frame.setChannel(number);
|
|
||||||
QByteArray arguments_;
|
|
||||||
QDataStream out(&arguments_, QIODevice::WriteOnly);
|
|
||||||
out << qint16(0); //reserver 1
|
|
||||||
Frame::writeField('s', out, name);
|
|
||||||
out << qint8(0); // no-wait
|
|
||||||
frame.setArguments(arguments_);
|
|
||||||
sendFrame(frame);
|
|
||||||
}
|
|
||||||
|
|
||||||
void QueuePrivate::bind(const QString &exchangeName, const QString &key)
|
void QueuePrivate::bind(const QString &exchangeName, const QString &key)
|
||||||
{
|
{
|
||||||
if (!opened) {
|
if (!opened) {
|
||||||
|
|
|
||||||
|
|
@ -25,7 +25,6 @@ public:
|
||||||
|
|
||||||
void declare();
|
void declare();
|
||||||
void remove(bool ifUnused = true, bool ifEmpty = true, bool noWait = true);
|
void remove(bool ifUnused = true, bool ifEmpty = true, bool noWait = true);
|
||||||
void purge();
|
|
||||||
void bind(const QString &exchangeName, const QString &key);
|
void bind(const QString &exchangeName, const QString &key);
|
||||||
void unbind(const QString &exchangeName, const QString &key);
|
void unbind(const QString &exchangeName, const QString &key);
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue