Re: [go-nuts] How do you implement and use Context.Done?

2017-02-21 Thread 'Thomas Bushnell, BSG' via golang-nuts
Oops! ::blush:: On Tue, Feb 21, 2017 at 11:39 AM Axel Wagner wrote: > Wrong list :) You meant to link here: > https://godoc.org/context#Context.Err > > On Tue, Feb 21, 2017 at 8:15 PM, 'Thomas Bushnell, BSG' via golang-nuts < > golang-nuts@googlegroups.com> wrote:

Re: [go-nuts] How do you implement and use Context.Done?

2017-02-21 Thread Ian Lance Taylor
On Tue, Feb 21, 2017 at 12:45 PM, Ian Lance Taylor wrote: > On Tue, Feb 21, 2017 at 11:15 AM, Thomas Bushnell, BSG > wrote: >> On Mon, Feb 20, 2017 at 11:42 AM Ian Lance Taylor wrote: >>> >>> On Sun, Feb 19, 2017 at 2:57 PM,

Re: [go-nuts] How do you implement and use Context.Done?

2017-02-21 Thread Ian Lance Taylor
On Tue, Feb 21, 2017 at 11:15 AM, Thomas Bushnell, BSG wrote: > On Mon, Feb 20, 2017 at 11:42 AM Ian Lance Taylor wrote: >> >> On Sun, Feb 19, 2017 at 2:57 PM, wrote: >> > Thanks, I see you build it up with decorators on a standard

Re: [go-nuts] How do you implement and use Context.Done?

2017-02-21 Thread 'Axel Wagner' via golang-nuts
Wrong list :) You meant to link here: https://godoc.org/context#Context.Err On Tue, Feb 21, 2017 at 8:15 PM, 'Thomas Bushnell, BSG' via golang-nuts < golang-nuts@googlegroups.com> wrote: > On Mon, Feb 20, 2017 at 11:42 AM Ian Lance Taylor wrote: > >> On Sun, Feb 19, 2017 at

Re: [go-nuts] How do you implement and use Context.Done?

2017-02-21 Thread 'Thomas Bushnell, BSG' via golang-nuts
On Mon, Feb 20, 2017 at 11:42 AM Ian Lance Taylor wrote: > On Sun, Feb 19, 2017 at 2:57 PM, wrote: > > Thanks, I see you build it up with decorators on a standard prototype. > > For example: https://play.golang.org/p/PJy5lE9QqF > > > > So context.Done is a

Re: [go-nuts] How do you implement and use Context.Done?

2017-02-20 Thread so . query
I see thanks for the additional detail. On Monday, February 20, 2017 at 11:42:48 AM UTC-8, Ian Lance Taylor wrote: > > On Sun, Feb 19, 2017 at 2:57 PM, > wrote: > > Thanks, I see you build it up with decorators on a standard prototype. > > For example:

Re: [go-nuts] How do you implement and use Context.Done?

2017-02-20 Thread Ian Lance Taylor
On Sun, Feb 19, 2017 at 2:57 PM, wrote: > Thanks, I see you build it up with decorators on a standard prototype. > For example: https://play.golang.org/p/PJy5lE9QqF > > So context.Done is a convenience function for those that require it? > Otherwise a context will expire

Re: [go-nuts] How do you implement and use Context.Done?

2017-02-19 Thread Sina Siadat
Done function returns a channel which is closed when our context is done, i.e., it is either timed out, its deadline is exceeded, or explicitly canceled. This channel closing is a pattern used for broadcasting a signal to multiple goroutines that are receiving from it. Let's say we have 2

Re: [go-nuts] How do you implement and use Context.Done?

2017-02-19 Thread Matt Harden
Done does not need to be called unless you want to detect when the context is either canceled or times out. It doesn't have any effect on the context itself. On Sun, Feb 19, 2017 at 2:57 PM wrote: > Thanks, I see you build it up with decorators on a standard prototype. > For

Re: [go-nuts] How do you implement and use Context.Done?

2017-02-19 Thread so . query
Thanks, I see you build it up with decorators on a standard prototype. For example: https://play.golang.org/p/PJy5lE9QqF So context.Done is a convenience function for those that require it? Otherwise a context will expire after it leaves scope, so Done does not need to be called? On

Re: [go-nuts] How do you implement and use Context.Done?

2017-02-17 Thread Ian Lance Taylor
On Fri, Feb 17, 2017 at 1:34 PM, wrote: > I'm not sure how to implement and use the Done function and its returned > channel for contexts. > https://golang.org/pkg/context/#Context > > The comments say to refer to https://blog.golang.org/pipelines, but I didn't > see any

[go-nuts] How do you implement and use Context.Done?

2017-02-17 Thread so . query
I'm not sure how to implement and use the Done function and its returned channel for contexts. https://golang.org/pkg/context/#Context The comments say to refer to https://blog.golang.org/pipelines, but I didn't see any example there. Can you provide an example of how to implement a context