package grpcsync
Import Path
google.golang.org/grpc/internal/grpcsync (on go.dev)
Dependency Relation
imports 2 packages, and imported by 2 packages
Involved Source Files
Package grpcsync implements additional synchronization primitives built upon
the sync package.
oncefunc.go
Package-Level Type Names (only one, which is exported)
Event represents a one-time event that may occur in the future.
c chan struct{}
fired int32
o sync.Once
Done returns a channel that will be closed when Fire is called.
Fire causes e to complete. It is safe to call multiple times, and
concurrently. It returns true iff this call to Fire caused the signaling
channel returned by Done to close.
HasFired returns true if Fire has been called.
func NewEvent() *Event
Package-Level Functions (total 2, both are exported)
NewEvent returns a new, ready-to-use Event.
OnceFunc returns a function wrapping f which ensures f is only executed
once even if the returned function is executed multiple times.
The pages are generated with Golds v0.4.9. (GOOS=linux GOARCH=amd64)