From c0cab43513d2957172c1da1b18052b2f9328e530 Mon Sep 17 00:00:00 2001 From: Graham Christensen Date: Tue, 30 Jan 2018 20:30:46 -0500 Subject: [PATCH] fixup --- ofborg/src/bin/builder.rs | 2 +- ofborg/src/easyamqp.rs | 38 ++++++++++++++++++++++++++++++++++++-- 2 files changed, 37 insertions(+), 3 deletions(-) diff --git a/ofborg/src/bin/builder.rs b/ofborg/src/bin/builder.rs index 2b342d8..2a0b418 100644 --- a/ofborg/src/bin/builder.rs +++ b/ofborg/src/bin/builder.rs @@ -57,8 +57,8 @@ fn main() { consumer_tag: format!("{}-builder", cfg.whoami()), no_local: false, no_ack: false, + no_wait: false, exclusive: false, - nowait: false, arguments: None }, ) diff --git a/ofborg/src/easyamqp.rs b/ofborg/src/easyamqp.rs index bf0354c..ac43b75 100644 --- a/ofborg/src/easyamqp.rs +++ b/ofborg/src/easyamqp.rs @@ -5,12 +5,46 @@ use amqp; use amqp::Basic; pub struct ConsumeConfig { + /// Specifies the name of the queue to consume from. pub queue: String, + + /// Specifies the identifier for the consumer. The consumer tag is + /// local to a channel, so two clients can use the same consumer + /// tags. If this field is empty the server will generate a unique + /// tag. + /// + /// The client MUST NOT specify a tag that refers to an existing + /// consumer. Error code: not-allowed pub consumer_tag: String, + + /// If the no-local field is set the server will not send messages + /// to the connection that published them. pub no_local: bool, + + /// If this field is set the server does not expect + /// acknowledgements for messages. That is, when a message is + /// delivered to the client the server assumes the delivery will + /// succeed and immediately dequeues it. This functionality may + /// increase performance but at the cost of reliability. Messages + /// can get lost if a client dies before they are delivered to the + /// application. pub no_ack: bool, + + /// Request exclusive consumer access, meaning only this consumer + /// can access the queue. + /// + /// The client MAY NOT gain exclusive access to a queue that + /// already has active consumers. Error code: access-refused pub exclusive: bool, - pub nowait: bool, + + /// If set, the server will not respond to the method. The client + /// should not wait for a reply method. If the server could not + /// complete the method it will raise a channel or connection + /// exception. + pub no_wait: bool, + + /// A set of arguments for the consume. The syntax and semantics + /// of these arguments depends on the server implementation. pub arguments: Option, } @@ -59,7 +93,7 @@ impl TypedWrappers for amqp::Channel { config.no_local, config.no_ack, config.exclusive, - config.nowait, + config.no_wait, config.arguments.unwrap_or(amqp::Table::new()), ) }