Google Groups

Re: [ANN] tomb package updated


kortschak Apr 3, 2012 2:28 PM
Posted in group: golang-nuts
Hi Gustavo,

The docs at labix which the blog points to are now very much out of date, and I want to remind you of the nice multiple goroutine control construction that Rog Peppe suggested here some time ago (https://groups.google.com/forum/?fromgroups#!topic/golang-nuts/mFjpIuEQH2M), for inclusion in the blog or docs.

thanks
Dan

On Wednesday, 4 April 2012 06:29:29 UTC+9:30, Gustavo Niemeyer wrote:
Greetings,

An update to the tomb package has just been pushed with the
following changes:

- ErrStillRunning is now ErrStillAlive, to conform to the terminology.

- ErrDying introduced. When the tomb state changes to dying and there's
  still logic going on within the goroutine, nested functions and methods
  may choose to return ErrDying as their error value, as this error won't
  alter the tomb state if provied to the Kill method. This is a convenient
  way to follow standard Go practices in the context of a dying tomb.

The blog post explaining the tomb package usage has also been updated
to cover the new API. It has a nice example explaining how to use it:

    http://blog.labix.org/2011/10/09/death-of-goroutines-under-control

Please drop a note in case you want some help using it.

--
Gustavo Niemeyer
http://niemeyer.net
http://niemeyer.net/plus
http://niemeyer.net/twitter
http://niemeyer.net/blog

-- I'm not absolutely sure of anything.