Top 1.4% dependent packages on proxy.golang.org
Top 1.3% dependent repos on proxy.golang.org
Top 8.8% forks on proxy.golang.org
proxy.golang.org : golang.design/x/mainthread
Package mainthread offers facilities to schedule functions on the main thread. To use this package properly, one must call `mainthread.Init` from the main package. For example: If the given function triggers a panic, and called via `mainthread.Call`, then the panic will be propagated to the same goroutine. One can capture that panic, when possible: If the given function triggers a panic, and called via `mainthread.Go`, then the panic will be cached internally, until a call to the `Error()` method: Note that a panic happens before `mainthread.Error()` returning the panicked error. If one needs to guarantee `mainthread.Error()` indeed captured the panic, a dummy function can be used as synchornization: It is possible to cache up to a maximum of 42 panicked errors. More errors are ignored.
Registry
- Homepage
- Documentation
- JSON
purl: pkg:golang/golang.design/x/mainthread
Keywords:
go
, golang
, mainthread
License: MIT
Latest release: almost 4 years ago
First release: over 4 years ago
Namespace: golang.design/x
Dependent packages: 14
Dependent repositories: 16
Stars: 34 on GitHub
Forks: 4 on GitHub
See more repository details: repos.ecosyste.ms
Funding links: https://github.com/sponsors/golang-design
Last synced: 17 days ago