-
Notifications
You must be signed in to change notification settings - Fork 443
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
restore SetMaxInFlight dropped in refactoring #46
Conversation
The importance of this over updating config directly is that it also sends out the updated value to all open connections |
RFR @mreiferson |
For the record, I dropped this function intentionally, but forgot to restore the related functionality. Oops. My goal was to eliminate any ambiguity for The Right Way™ to set config parameters. Unfortunately, this change goes back in the other direction as implemented. I have two suggestions for alternative approaches:
Thoughts? |
This really brings to mind that perhaps the whole config struct should be immutable once passed to a Consumer or Producer object, and that things that need to be mutated (like this) need their own Interface. It's possible some could be changed and have a delegate system to mutate existing state, but many can not (like changing tls settings). I'm also sensitive to avoiding changes in the api where we don't really need them because it's busy work multiplied by the size of code base using the existing api (which for me is a real pain point). To me, changing the max-in-flight is slightly diff need than pause/unpause, though that's certainly one use. |
I think making RE: changes in general - this is our "one" opportunity to clean things up while we are already making backwards incompatible changes. It seemed inconsistent to set I'd like to think I've written a fair number of consumers and haven't once used the functionality we're discussing. Obviously that doesn't mean there aren't use cases or that folks weren't depending on being able to do this (somehow). But it seems worth discussing, what actually is your use case? |
The use case is generally to be able to dynamically change throughput based on server state. We currently trigger this by touching or removing a file, and use fsnotify to observe that state change and make appropriate changes in max in flight. (obviously all our consumers also use SetMaxInFlight to set their initial throughput settings) |
Right, but that's pausing and unpausing. I should have been more specific, I was asking the question about arbitrarily adjusting |
@mreiferson I'll let you propose some other ways to change this API wise before we hit 1.0, but i'm going to merge to restore this for now so i'm no longer blocked on this functionality in incorporating these api changes into the bitly stack. |
restore SetMaxInFlight dropped in refactoring
I've proposed some alternatives here. I'm curious to hear your thoughts on those... You need not be blocked on moving forward with your changes just because this wasn't merged. There are always ways of building off of branches in the interim. Let's reach agreement before we merge things where there isn't obvious resolution. |
One more suggestion. Perhaps it's really just the name that bothers me. I would like the name reflect that it isn't necessary to use this method to set/configure the What about I would also like the function comments to reflect its intended use case more accurately (for example, it still refers to "reader"). |
or |
Would you be amenable to making these changes? |
naming was modified to |
Consumer needs to export a way to update the max-in-flight as a way to pause or resume a client from doing work. This was accidentally dropped in #30