MCPcopy Index your code
hub / github.com/php/frankenphp / notifySubscribers

Method notifySubscribers

internal/state/state.go:135–151  ·  view source on GitHub ↗
(nextState State)

Source from the content-addressed store, hash-verified

133}
134
135func (ts *ThreadState) notifySubscribers(nextState State) {
136 if len(ts.subscribers) == 0 {
137 return
138 }
139
140 n := 0
141 for _, sub := range ts.subscribers {
142 if !slices.Contains(sub.states, nextState) {
143 ts.subscribers[n] = sub
144 n++
145 continue
146 }
147 close(sub.ch)
148 }
149
150 ts.subscribers = ts.subscribers[:n]
151}
152
153// WaitFor blocks until the thread reaches a certain state
154func (ts *ThreadState) WaitFor(states ...State) {

Callers 3

CompareAndSwapMethod · 0.95
SetMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected