the derived deferred classes now also re-implement the onSuccess() method to ensure that the same object type is returned, to support propert chaining
This commit is contained in:
parent
1fecc57d67
commit
e903cdb4ee
|
|
@ -334,11 +334,6 @@ public:
|
|||
/**
|
||||
* Publish a message to an exchange
|
||||
*
|
||||
* If either of the two flags is set, and the message could not immediately
|
||||
* be published, the message is returned by the server to the client. If you
|
||||
* want to catch such returned messages, you need to install a handler using
|
||||
* the onReturned() method.
|
||||
*
|
||||
* @param exchange the exchange to publish to
|
||||
* @param routingkey the routing key
|
||||
* @param envelope the full envelope to send
|
||||
|
|
|
|||
|
|
@ -75,9 +75,17 @@ public:
|
|||
}
|
||||
|
||||
/**
|
||||
* All the onSuccess() functions defined in the base class are accessible too
|
||||
* Register the function that is called when the cancel operation succeeded
|
||||
* @param callback
|
||||
*/
|
||||
using Deferred::onSuccess;
|
||||
DeferredCancel &onSuccess(const SuccessCallback &callback)
|
||||
{
|
||||
// call base
|
||||
Deferred::onSuccess(callback);
|
||||
|
||||
// allow chaining
|
||||
return *this;
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -75,6 +75,19 @@ public:
|
|||
return *this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Register the function that is called when the consumer starts
|
||||
* @param callback
|
||||
*/
|
||||
DeferredConsumer &onSuccess(const SuccessCallback &callback)
|
||||
{
|
||||
// call base
|
||||
Deferred::onSuccess(callback);
|
||||
|
||||
// allow chaining
|
||||
return *this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Register a function to be called when a message arrives
|
||||
* This fuction is also available as onMessage() because I always forget which name I gave to it
|
||||
|
|
@ -102,11 +115,6 @@ public:
|
|||
// allow chaining
|
||||
return *this;
|
||||
}
|
||||
|
||||
/**
|
||||
* All the onSuccess() functions defined in the base class are accessible too
|
||||
*/
|
||||
using Deferred::onSuccess;
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -80,9 +80,17 @@ public:
|
|||
}
|
||||
|
||||
/**
|
||||
* All the onSuccess() functions defined in the base class are accessible too
|
||||
* Register the function that is called when the queue is deleted or purged
|
||||
* @param callback
|
||||
*/
|
||||
using Deferred::onSuccess;
|
||||
DeferredDelete &onSuccess(const SuccessCallback &callback)
|
||||
{
|
||||
// call base
|
||||
Deferred::onSuccess(callback);
|
||||
|
||||
// allow chaining
|
||||
return *this;
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -80,9 +80,17 @@ public:
|
|||
}
|
||||
|
||||
/**
|
||||
* All the onSuccess() functions defined in the base class are accessible too
|
||||
* Register the function that is called when the queue is declared
|
||||
* @param callback
|
||||
*/
|
||||
using Deferred::onSuccess;
|
||||
DeferredQueue &onSuccess(const SuccessCallback &callback)
|
||||
{
|
||||
// call base
|
||||
Deferred::onSuccess(callback);
|
||||
|
||||
// allow chaining
|
||||
return *this;
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Reference in New Issue