https://github.com/mmcshane/nls
Non-lexical Scopes for Go
https://github.com/mmcshane/nls
go golang resource-management scoping
Last synced: 11 months ago
JSON representation
Non-lexical Scopes for Go
- Host: GitHub
- URL: https://github.com/mmcshane/nls
- Owner: mmcshane
- License: unlicense
- Created: 2019-06-14T18:46:54.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2021-10-15T23:32:31.000Z (over 4 years ago)
- Last Synced: 2025-01-17T06:23:27.688Z (over 1 year ago)
- Topics: go, golang, resource-management, scoping
- Language: Go
- Size: 6.84 KB
- Stars: 1
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# NLS is Non-lexical Scopes for Go
[](https://godoc.org/github.com/mmcshane/nls)
Go has `defer` which gives something approaching strict lexical lifetimes for
resource management but there is no direct support for object or resource
lifetimes that may outlive the function in which they are created. This small
library allows the user to create a tree of scope instances, each of which owns
the lifetime of zero or more resource-consuming objects (e.g. goroutines,
sockets, gRPC clients, etc) and which can be used to cleanly release said
resources.