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

Connection pooling #1

Closed
cespare opened this issue Sep 12, 2013 · 5 comments
Closed

Connection pooling #1

cespare opened this issue Sep 12, 2013 · 5 comments
Assignees

Comments

@cespare
Copy link

cespare commented Sep 12, 2013

It makes sense to implement this in the driver, rather than forcing each user to implement it themselves.

We should learn from database/sql and make the pool size configurable from the start.

@ghost ghost assigned dancannon Sep 12, 2013
@dancannon dancannon mentioned this issue Sep 13, 2013
15 tasks
@robert-zaremba
Copy link
Contributor

database/sql naming is good to follow.

Regards this issue there are interesting updates in upcoming go 1.2 release, which touch connection pools: http://www.honnef.co/go-tip/2013-09-07/#sql

@dancannon
Copy link
Collaborator

With help from @crosbymichael I have added connection pools using a similar technique to RedisGo. I will revisit connection pools with the Go 1.2 release and see if there are significant improvements.

@robert-zaremba what do you mean about following the database/sql naming?

@robert-zaremba
Copy link
Contributor

@cespare said:

We should learn from database/sql and make the pool size configurable from the start.

I meant that it's a good idea to use the same names as in database/sql where the functionality is the same:

  • func (*DB) SetMaxIdleConns(n int)
  • func (*DB).SetMaxOpenConns(int).
  • func (*DB) Ping() error

http://tip.golang.org/pkg/database/sql/#pkg-index

@dancannon
Copy link
Collaborator

Ah ok, I agree I will look into making these changes later today.

@dancannon
Copy link
Collaborator

Ok I have added the SetMaxIdleConns and SetMaxOpenConns methods so I am now closing this issue.

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

No branches or pull requests

3 participants