Ecosyste.ms: Funds
An open API service for providing issue and pull request metadata for open source projects.
https://github.com/go-tomb/tomb
Last synced: about 4 hours ago
Repository metadata:
The tomb package helps with clean goroutine termination in the Go language.
- Host: GitHub
- URL: https://github.com/go-tomb/tomb
- Owner: go-tomb
- License: other
- Created: 2014-05-29T07:08:11.000Z (over 10 years ago)
- Default Branch: v1
- Last Pushed: 2023-01-20T15:55:54.000Z (almost 2 years ago)
- Last Synced: 2024-10-29T19:59:58.270Z (11 days ago)
- Language: Go
- Size: 48.8 KB
- Stars: 368
- Watchers: 3
- Forks: 41
- Open Issues: 16
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Owner metadata:
- Name: go-tomb
- Login: go-tomb
- Email:
- Kind: organization
- Description:
- Website:
- Location:
- Twitter:
- Company:
- Icon url: https://avatars.githubusercontent.com/u/6865653?v=4
- Repositories: 1
- Last Synced at: 2023-12-19T15:40:33.250Z
- Profile URL: https://github.com/go-tomb
- Sponsor URL:
Committers metadata
Last synced: about 7 hours ago
Total Commits: 30
Total Committers: 3
Avg Commits per committer: 10.0
Development Distribution Score (DDS): 0.233
Commits in past year: 0
Committers in past year: 0
Avg Commits per committer in past year: 0.0
Development Distribution Score (DDS) in past year: 0.0
Name | Commits | |
---|---|---|
Gustavo Niemeyer | g****o@n****t | 23 |
Roger Peppe | r****e@c****m | 6 |
George Hartzell | h****l@a****m | 1 |
Issue and Pull Request metadata
Last synced: 1 day ago
Package metadata
- Total packages: 4
- Total downloads: unknown
- Total docker downloads: 11,739,033,559
- Total dependent packages: 9,088 (may contain duplicates)
- Total dependent repositories: 101,649 (may contain duplicates)
- Total versions: 6
go: gopkg.in/tomb.v1
The tomb package offers a conventional API for clean goroutine termination. A Tomb tracks the lifecycle of a goroutine as alive, dying or dead, and the reason for its death. The zero value of a Tomb assumes that a goroutine is about to be created or already alive. Once Kill or Killf is called with an argument that informs the reason for death, the goroutine is in a dying state and is expected to terminate soon. Right before the goroutine function or method returns, Done must be called to inform that the goroutine is indeed dead and about to stop running. A Tomb exposes Dying and Dead channels. These channels are closed when the Tomb state changes in the respective way. They enable explicit blocking until the state changes, and also to selectively unblock select statements accordingly. 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 provided to the Kill method. This is a convenient way to follow standard Go practices in the context of a dying tomb. For background and a detailed example, see the following blog post: For a more complex code snippet demonstrating the use of multiple goroutines with a single Tomb, see:
- Homepage: https://github.com/go-tomb/tomb
- Documentation: https://pkg.go.dev/gopkg.in/tomb.v1#section-documentation
- Licenses: BSD-3-Clause
- Latest release: v1.0.0-20141024135613-dd632973f1e7 (published about 10 years ago)
- Last Synced: 2024-11-09T00:08:30.907Z (1 day ago)
- Versions: 2
- Dependent Packages: 8,277
- Dependent Repositories: 99,833
- Docker Downloads: 4,624,782,442
-
Rankings:
- Dependent repos count: 0.011%
- Dependent packages count: 0.022%
- Docker downloads count: 0.068%
- Average: 1.412%
- Stargazers count: 3.018%
- Forks count: 3.941%
go: gopkg.in/tomb.v2
The tomb package handles clean goroutine tracking and termination. The zero value of a Tomb is ready to handle the creation of a tracked goroutine via its Go method, and then any tracked goroutine may call the Go method again to create additional tracked goroutines at any point. If any of the tracked goroutines returns a non-nil error, or the Kill or Killf method is called by any goroutine in the system (tracked or not), the tomb Err is set, Alive is set to false, and the Dying channel is closed to flag that all tracked goroutines are supposed to willingly terminate as soon as possible. Once all tracked goroutines terminate, the Dead channel is closed, and Wait unblocks and returns the first non-nil error presented to the tomb via a result or an explicit Kill or Killf method call, or nil if there were no errors. It is okay to create further goroutines via the Go method while the tomb is in a dying state. The final dead state is only reached once all tracked goroutines terminate, at which point calling the Go method again will cause a runtime panic. Tracked functions and methods that are still running while the tomb is in dying state may choose to return ErrDying as their error value. This preserves the well established non-nil error convention, but is understood by the tomb as a clean termination. The Err and Wait methods will still return nil if all observed errors were either nil or ErrDying. For background and a detailed example, see the following blog post:
- Homepage: https://github.com/go-tomb/tomb
- Documentation: https://pkg.go.dev/gopkg.in/tomb.v2#section-documentation
- Licenses: BSD-3-Clause
- Latest release: v2.0.0-20161208151619-d5d1b5820637 (published almost 8 years ago)
- Last Synced: 2024-11-09T21:02:32.170Z (about 8 hours ago)
- Versions: 2
- Dependent Packages: 811
- Dependent Repositories: 1,814
- Docker Downloads: 7,114,251,117
-
Rankings:
- Docker downloads count: 0.041%
- Dependent packages count: 0.145%
- Dependent repos count: 0.189%
- Average: 1.467%
- Stargazers count: 3.018%
- Forks count: 3.941%
go: github.com/go-tomb/tomb
The tomb package offers a conventional API for clean goroutine termination. A Tomb tracks the lifecycle of a goroutine as alive, dying or dead, and the reason for its death. The zero value of a Tomb assumes that a goroutine is about to be created or already alive. Once Kill or Killf is called with an argument that informs the reason for death, the goroutine is in a dying state and is expected to terminate soon. Right before the goroutine function or method returns, Done must be called to inform that the goroutine is indeed dead and about to stop running. A Tomb exposes Dying and Dead channels. These channels are closed when the Tomb state changes in the respective way. They enable explicit blocking until the state changes, and also to selectively unblock select statements accordingly. 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 provided to the Kill method. This is a convenient way to follow standard Go practices in the context of a dying tomb. For background and a detailed example, see the following blog post: For a more complex code snippet demonstrating the use of multiple goroutines with a single Tomb, see:
- Homepage: https://github.com/go-tomb/tomb
- Documentation: https://pkg.go.dev/github.com/go-tomb/tomb#section-documentation
- Licenses: BSD-3-Clause
- Latest release: v0.0.0-20140916011937-6d544e327bd5 (published about 10 years ago)
- Last Synced: 2024-11-09T00:08:26.984Z (1 day ago)
- Versions: 1
- Dependent Packages: 0
- Dependent Repositories: 2
-
Rankings:
- Stargazers count: 3.014%
- Dependent repos count: 3.485%
- Forks count: 3.938%
- Average: 4.997%
- Dependent packages count: 9.553%
go: gopkg.in/go-tomb/tomb.v2
The tomb package handles clean goroutine tracking and termination. The zero value of a Tomb is ready to handle the creation of a tracked goroutine via its Go method, and then any tracked goroutine may call the Go method again to create additional tracked goroutines at any point. If any of the tracked goroutines returns a non-nil error, or the Kill or Killf method is called by any goroutine in the system (tracked or not), the tomb Err is set, Alive is set to false, and the Dying channel is closed to flag that all tracked goroutines are supposed to willingly terminate as soon as possible. Once all tracked goroutines terminate, the Dead channel is closed, and Wait unblocks and returns the first non-nil error presented to the tomb via a result or an explicit Kill or Killf method call, or nil if there were no errors. It is okay to create further goroutines via the Go method while the tomb is in a dying state. The final dead state is only reached once all tracked goroutines terminate, at which point calling the Go method again will cause a runtime panic. Tracked functions and methods that are still running while the tomb is in dying state may choose to return ErrDying as their error value. This preserves the well established non-nil error convention, but is understood by the tomb as a clean termination. The Err and Wait methods will still return nil if all observed errors were either nil or ErrDying. For background and a detailed example, see the following blog post:
- Homepage: https://github.com/go-tomb/tomb
- Documentation: https://pkg.go.dev/gopkg.in/go-tomb/tomb.v2#section-documentation
- Licenses: BSD-3-Clause
- Latest release: v2.0.0-20161208151619-d5d1b5820637 (published almost 8 years ago)
- Last Synced: 2024-11-09T00:08:29.351Z (1 day ago)
- Versions: 1
- Dependent Packages: 0
- Dependent Repositories: 0
-
Rankings:
- Stargazers count: 1.83%
- Forks count: 2.336%
- Average: 5.128%
- Dependent packages count: 6.999%
- Dependent repos count: 9.346%