-
-
Notifications
You must be signed in to change notification settings - Fork 45
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
Cannot create_bucket with queued=True #37
Comments
You need to run Feel free to improve the documentation if you found it lacking. |
Documentation is pretty good, seems like I've just skipped this part -_- Nonetheless, what do you think about a warning in such a case? Or is this something that is intended for some scenarios? |
And is client.disconnect() mandatory or can I just let the program exit without calling it? |
Well, where should the warning go? IMO it should be fine to start queueing requests before connecting so I don't think that's the right time.
Nothing will break, but the last event might be lost otherwise so it's good practice. Best way IMO is to use |
@Otto-AA I'd be in favor of omitting a warning, limiting it to once per run and disabling it by setting a kwarg to What do you think @johan-bjareholt? And yes, on further thought |
I don't agree with this, setting a kwarg only to disable a warning message is dirty IMO. |
@johan-bjareholt It should be really rare to not want the queue active if adding queued events or creating a queued bucket, and can understandably lead to confusion if one hasn't read the docs. There are other ways to ignore warnings here. Which do you prefer? |
Using I can do it with |
@ErikBjare Well, in that case I think we should just make a deprecated warning every time we queue before connecting and later disable it completely. However, it is currently unsupported to create a bucket after the RequestQueue has connected I believe so we have to fix that first (It's really stupid, I know but that's how it is due to how create_bucket previously was named setup_bucket but never changed behaviour to reflect that change). An extra call to self._create_buckets upon register_bucket should suffice. There's not really any benefit of creating buckets before connecting though, it's just more flexible to allow both. It is just the kwarg silencing I'm against, the idea is fine otherwise IMO and should fix this confusion. |
@Otto-AA What's hard about So, @johan-bjareholt, is this right then?
|
No, support calling create_bucket() AFTER connect() :p Preferably also add a TODO comment to make it impossible rather than just a warning in the future |
When using
queued=True
the client doesn't send the create_bucket request to the server.Steps to reproduce:
Start aw-server in testing mode:
aw-server --testing --verbose
Run following python script:
Expected behaviour
A bucket is created.
Context
The text was updated successfully, but these errors were encountered: