From 4d4c8230d2a5b28a5127b51744db8ec852e5ec87 Mon Sep 17 00:00:00 2001 From: joeybloggs Date: Fri, 11 Dec 2015 15:39:55 -0500 Subject: [PATCH] Update README --- README.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/README.md b/README.md index 1e8af54..dac5f64 100644 --- a/README.md +++ b/README.md @@ -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) @@ -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)