Open alreece45 opened 8 years ago
This is a very good idea. Currently, most of the methods on channel are a light wrappers to a corresponding Method struct constructor. This is because I didn't have time to think about the actual "rustic" API, but rather make something low-level, which just works and is familiar to someone who knows AMQP. See: http://www.rabbitmq.com/amqp-0-9-1-reference.html#exchange.declare
It was planned to add a more friendly API on top of the low level protocol implementation. About this api, what would be the default values for those fields (durable, passive, exclusive, auto_delete, no_wait), all false?
Yep. All false seems to be reasonable expectations.
Hi, I'm trying to get some feedback (comments) on an idea for the API before spending too much time working on it.
The number of arguments in declare_exchange() is a bit excessive and not very Rustic. I suggest maybe using a Builder pattern instead, while having the API utilize an Into to allow for more flexibility (e.g: implementing From to allow creating a direct exchange, with just a string).
Consumers would be able to do:
The API would probably similar to this, though Cow isn't required, but using the Into<> trait is probably beneficial.
This API does not attempt to address arguments with the table. When I looked, the usage of the Table wasn't clear and its usage should be more clarified, possibily similar to this one.
If the above API is acceptable, the protocol::Method implementation will need to access the structure members somehow. It seems like these types, and the protocol::Method implementation would be best in their own module, with private members-- but that lead to a more extensive update.