Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Docstring improvements #45

Open
mmiller-max opened this issue Sep 2, 2021 · 1 comment
Open

Docstring improvements #45

mmiller-max opened this issue Sep 2, 2021 · 1 comment

Comments

@mmiller-max
Copy link

Hi there, I've been enjoying using this package and am keen to help improve docstrings. My motivation for this is I've been having to check the source code to find kwargs/default values of kwargs. A lot of this may be fine for someone who is more familiar with AMQP and that may be why there is not a lot of detail in it, but do you think the below change to the queue_declare is useful? If so I can update a few more (e.g. for the functions that are mentioned in the various markdown docs).

    queue_declare(chan::MessageChannel,
                  name::String;
                  passive::Bool=false,
                  durable::Bool=false,
                  exclusive::Bool=false,
                  auto_delete::Bool=false,
                  nowait::Bool=false,
                  timeout::Int=DEFAULT_TIMEOUT,
                  arguments::Dict{String,Any}=Dict{String,Any}())

Declare a queue (or query an existing queue).

To let the broke decide on the queue name, set `name` to `""`.

Returns a tuple: (boolean success/failure, queue name, message count, consumer count)

# Optional Arguments
- `passive::Bool=false`: if `true`, the server will reply with Declare-Ok if the queue already exists with the same name, and raise an error if not. 
- `durable::Bool=false`: if `true` the queue will survive a broker restart.
- `exclusive::Bool=false`: if `true` the queue will only be used by only one connection and the queue will be deleted when that connection closes.
- `auto_delete::Bool=false`: if `true` when the queue has had at least one consumer it is deleted when last consumer unsubscribes.
- `nowait::Bool=false`: if `true` the server will not respond. Errors will be raised via connection or channel exception.
- `timeout::Int=DEFAULT_TIMEOUT`:
- `arguments::Dict{String,Any}=Dict{String,Any}()`:  used by plugins and broker-specific features such as message TTL, queue length limit, etc.

Let me know, I'm happy to go through and add more docstrings if it'll be useful.

@tanmaykm
Copy link
Member

Sorry, noticed this perhaps a bit late. Sure, it will definitely be useful. Please feel free to put up a PR with more docstrings!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants