Skip to content

Commit

Permalink
Update README
Browse files Browse the repository at this point in the history
  • Loading branch information
joeybloggs authored and joeybloggs committed Dec 11, 2015
1 parent 4838a95 commit 4d4c823
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,10 @@ type resultStruct struct {
func main() {
p := pool.NewPool(4, 16)

// can add a consumer hook for each consumer routine to get a value from
// such as a database connection which each job can reuse via job.HookParam()
// p.AddConsumerHook(func() interface{}{ return db connection or whatever})

fn := func(job *pool.Job) {

i := job.Params()[0].(int)
Expand Down Expand Up @@ -117,6 +121,10 @@ import (
func main() {
p := pool.NewPool(4, 16)

// can add a consumer hook for each consumer routine to get a value from
// such as a database connection which each job can reuse via job.HookParam()
// p.AddConsumerHook(func() interface{}{ return db connection or whatever})

fn := func(job *pool.Job) {

i := job.Params()[0].(int)
Expand Down

0 comments on commit 4d4c823

Please sign in to comment.