Re: [go-nuts] context.Context and worker pools

2018-02-17 Thread andrey mirtchovski
thanks to both for your replies! On Fri, Feb 16, 2018 at 4:43 PM, 'Bryan Mills' via golang-nuts wrote: > Pool the resources, not the workers. > > For example, if your resource is “memory footprint of in-flight requests”, > use a semaphore instead. (There is a “worker pool” example in the package

Re: [go-nuts] context.Context and worker pools

2018-02-16 Thread 'Bryan Mills' via golang-nuts
Pool the resources, not the workers. For example, if your resource is “memory footprint of in-flight requests”, use a semaphore instead. (There is a “worker pool” example in the package docs.) If your resource is a fixed-size set of connections, y

Re: [go-nuts] context.Context and worker pools

2018-02-16 Thread Bruno Albuquerque
I did something like this here: https://github.com/brunoga/workerpool I do not store the context anywhere, I pass it to my Start() method and it passes it down to any place I need it. On Fri, Feb 16, 2018 at 1:05 PM andrey mirtchovski wrote: > While trying to retrofit context.Context within a