Navigation Menu

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

x/time: create new subrepo for x/time/rate, other code #13022

Closed
Sajmani opened this issue Oct 22, 2015 · 6 comments
Closed

x/time: create new subrepo for x/time/rate, other code #13022

Sajmani opened this issue Oct 22, 2015 · 6 comments

Comments

@Sajmani
Copy link
Contributor

Sajmani commented Oct 22, 2015

I would like to open-source a package rate that we developed at Google. It provides a rate limiter that supports Context for cancelation and deadlines: a caller can block until either the rate limiter allows the call to proceed or the Context is canceled. It includes an optimization to skip the wait if it would exceed the Context's Deadline. This package is widely used inside Google Go code.

There is no obvious home for this package in any of the golang repositories, so I propose we add a new subrepo, golang.org/x/time, that will contain the rate package as golang.org/x/time/rate. To justify the creation of a new subrepo, it would be useful to identify additional packages that belong here.

@adg
Copy link
Contributor

adg commented Oct 23, 2015

The "net" repo seems the obvious place for this, to me.

But my opinion aside, issue #12914 is a request for a monotonic clock
source. That seems like a candidate for inclusion for a potential "time"
repository.

On 23 October 2015 at 03:32, Sameer Ajmani notifications@github.com wrote:

I would like to open-source a package rate that we developed at Google.
It provides a rate limiter that supports (Context)[
https://godoc.org/golang.org/x/net/context] for cancelation and
deadlines: a caller can block until either the rate limiter allows the call
to proceed or the Context is canceled. It includes an optimization to skip
the wait if it would exceed the Context's Deadline. This package is widely
used inside Google Go code.

There is no obvious home for this package in any of the golang
repositories, so I propose we add a new subrepo, golang.org/x/time, that
will contain the rate package as golang.org/x/time/rate. To justify the
creation of a new subrepo, it would be useful to identify additional
packages that belong here.


Reply to this email directly or view it on GitHub
#13022.

@rsc rsc added this to the Proposal milestone Oct 24, 2015
@rsc
Copy link
Contributor

rsc commented Oct 24, 2015

There's nothing about networking in the package Sameer is talking about. It's important that net not become a dumping ground for "anything a server might want".

I think x/time is reasonable. One might envision calendar code going there too.

Who knows? Maybe even monotonic time support, although I am less convinced of that.

Anyway, an x/time repo seems reasonable.

/cc @robpike

@rsc rsc changed the title proposal: create the golang.org/x/time subrepo for package rate proposal: x/time: create new subrepo for x/time/rate, other code Oct 24, 2015
@bradfitz
Copy link
Contributor

Yes, my argument to Sameer was that "tools" became a dumping ground and now "net" is becoming a dumping ground. We also have a few things pending perfect for an "x/sync" subrepo if there were one.

Rather than thinking that a subrepo has a high cost, we should really think of a subrepo as a subdirectory of "x" where you can think of "x" as the same as, say, "google3".

@adg
Copy link
Contributor

adg commented Oct 24, 2015

I agree with @bradfitz we should be creating more repositories.

I'm not familiar with the rate package; it sounded intrinsically
network-related from its description.

On 24 October 2015 at 16:32, Brad Fitzpatrick notifications@github.com
wrote:

Yes, my argument to Sameer was that "tools" became a dumping ground and
now "net" is becoming a dumping ground. We also have a few things pending
perfect for an "x/sync" subrepo if there were one.

Rather than thinking that a subrepo has a high cost, we should really
think of a subrepo as a subdirectory of "x" where you can think of "x" as
the same as, say, "google3".


Reply to this email directly or view it on GitHub
#13022 (comment).

@rsc
Copy link
Contributor

rsc commented Oct 30, 2015

LGTM. Leaving for adg@ to create the subrepo.

@rsc rsc changed the title proposal: x/time: create new subrepo for x/time/rate, other code x/time: create new subrepo for x/time/rate, other code Oct 30, 2015
@rsc rsc assigned adg Oct 30, 2015
@Sajmani
Copy link
Contributor Author

Sajmani commented Nov 3, 2015

Thank you!

On Tue, Nov 3, 2015 at 1:58 AM, Andrew Gerrand notifications@github.com
wrote:

Closed #13022 #13022 via
golang/build@4154d4f
golang/build@4154d4f
.


Reply to this email directly or view it on GitHub
#13022 (comment).

@golang golang locked and limited conversation to collaborators Nov 4, 2016
@rsc rsc unassigned adg Jun 23, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

5 participants