INNER CODE UNIT · Go

func

spegel-org/spegel · internal/channel/gate.go:20

func (g *Gate) State() bool {
	g.mu.RLock()
	defer g.mu.RUnlock()

	return g.state
}

// Open opens the gate and informs any waiters.
func (g *Gate) Open() {
	g.set(true)
}

// Close closes the gate and informs any waiters.
func (g *Gate) Close() {
	g.set(false)
}

func (g *Gate) set(state bool) {

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…