futures: Implemented queue_unbind method
@@ -77,6 +77,11 @@ pub struct QueueDeclareOptions {
pub nowait: bool,
}
+#[derive(Clone,Debug,Default,PartialEq)]
+pub struct QueueUnbindOptions {
+ pub ticket: u16
+}
+
#[derive(Clone,Debug,Default,PartialEq)]
pub struct ConfirmSelectOptions {
pub nowait: bool,
@@ -231,6 +236,15 @@ impl<T: AsyncRead+AsyncWrite+Send+'static> Channel<T> {
})
}
+ /// unbinds a queue from the exchange
+ ///
+ /// returns a future that resolves once the queue is unbound from the exchange
+ pub fn queue_unbind(&self, name: &str, exchange: &str, routing_key: &str, options: &QueueUnbindOptions, arguments: &FieldTable) -> Box<Future<Item = (), Error = io::Error>> {
+ self.run_on_locked_transport("queue_unbind", "Could not unbind queue from the exchange", |transport| {
+ transport.conn.queue_unbind(self.id, options.ticket, name.to_string(), exchange.to_string(), routing_key.to_string(), arguments.clone()).map(Some)
+ })
+ }
+
/// sets up confirm extension for this channel
pub fn confirm_select(&self, options: &ConfirmSelectOptions) -> Box<Future<Item = (), Error = io::Error>> {
self.run_on_locked_transport("confirm_select", "Could not activate confirm extension", |transport| {
