Skip to content
This repository was archived by the owner on Feb 1, 2023. It is now read-only.

Latest commit

 

History

12 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Pool on Chan

Coverage Status Release Go Report Card Build Status

How to use it

import pool "github.com/deweppro/go-chan-pool"

type Object struct {
	I int64
}

func main() {
	cpool := &pool.ChanPool{
		Size: 1, // pool size
		New: func() interface{} { // handler for creating a new object in pool
			return &Object{}
		},
	}
	a := cpool.Get().(*Object) //get object from pool
	cpool.Put(a) //set object to pool
}

About

go chan pool

Topics

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages