-
Notifications
You must be signed in to change notification settings - Fork 534
Subscription.requestMore #21
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
Comments
Yeah, we thought about that at first, sadly it was too easy for people to think that you could "change your mind" by first doing "request(50)" and then "request(30)" and expect only 30 to be obeyed.
|
No it doesn't make sense. It is invalid to request "more" when nothing has yet been requested and having "more" does not communicate semantics of "change your mind" any better than "request" does. Once a request is submitted of course you can not "change your mind". |
Fair enough, how about |
I just don't see why we need a suffix to "request". It comes across as unnecessary noise. |
@benjchristensen I'll make you a deal, let's just call it |
@benjchristensen @viktorklang this is why on the other issue I brought up the idea of I also am a little sketchy on the "request" part of the method name because that IMO implies a return value. Like I'm requesting a certain number of elements be returned to me, which is not what's happening. |
@jbrisbin It's not a question if it has more or not though. It's a signal of demand: "I request that you give me N elements" What about (As an aside, shouldn't we focus less of our energy on bikeshedding names and more on semantics :-) ) |
@viktorklang names have importance because they should signal intent. The names should be the semantics as far as possible. So I understand the notion that names aren't important but I disagree: names are everything. :) I get the the signal of demand thing. I just doubt that it's enough to make an informed decision about what to do if N elements aren't available. I fear the situation will be the same as blindly creating Iterators over empty collections which is simple to do in code but extremely expensive in practice while under load. |
@jbrisbin I’m with you concerning clarity of naming and accordance with intent: what the method shall express is “signal additional demand for N units”, which is very clear. Shall we name it such? BTW: I do not understand how empty collections enter the picture; sending demand has nothing to do with its fulfillment. It is rather unfortunate that there is such a big semantic gap between demand (n) and “to demand”. Unfortunately the alternatives are even worse—wish, desire, want, … |
@rkhun |
Or, just more(int) (which I was about to suggest in one of my first posts before Viktor convinced me to stay out of bikeshedding...) |
@DougLea Haha, ok, so another one for |
I’d have to disagree: |
Apparently unusualness is what we want, to avoid misinterpretation. |
@DougLea There's also the opportunity for
|
+1 to "more" being strange and to simplifying to just |
I think I would also vote for |
This change is included in #40 |
Any particular reason for the "more" in
requestMore
?It seems redundant to have "more", or non-applicable on the first invocation of it when nothing has yet been requested hence "more" is wrong.
Perhaps it's cleaner to just say:
The text was updated successfully, but these errors were encountered: