KO
|
EN
gitlite — search
Search
#python
#java
#python3
#arduino
#golang
#machine-learning
#rust
#html
#flask
#javascript
#seismology
#nodejs
mgop
★ 13
Open GitHub ↗
session pool for mgo
Download README (.md)
Explore Similar Repositories
thumb
:
Time and Attendance App for ERPNext
LYJSwiftDemo
:
平时开发写的一些小控件 swift版本
miteFinder
:
No description available.
robopon
:
Robot Poncots (ロボポン) Sun and Star (Japanese)
terraform-vpc
:
Modular Terraform repository to provision a multi-tier VPC in AWS
// repository documentation
Was this content helpful?
★ 0
(0 ratings)
Select Rating:
★
★
★
★
★
Submit Feedback
Recent Feedback
×
Download README
Do you want to download the
README.md
file for
mgop
?
Download (.md)
# mgop<br> [](https://godoc.org/github.com/JodeZer/mgop) a mgo session pool still need more work... ``` go get gopkg.in/mgo.v2 go get github.com/JodeZer/mgop ``` with mgo, client hosts may create too much connections by using Copy method in high concurrency situation,like this ```go func foo(){ s := globalSession.Copy() defer s.Close() } ``` especially when using mgo.Eventual mode. mgop helps mongo doing better in high concurrency situation by buffering some sockets and tranporting requests through these sockets. ```go func foo(){ p, _ := mgop.DialPool("127.0.0.1:27017", 5) session := p.AcquireSession() defer session.Release() session.DB("test").C("test").Insert(bson.M{"id":1}) } ``` more deatils seeing example folder