Skip to content

CardInfoLink/mgop

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

mgop
GoDoc

a mgo session pool still need more work...

go get github.com/CardInfoLink/mgo
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

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.

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

Releases

No releases published

Packages

 
 
 

Languages

  • Go 100.0%