MCPcopy
hub / github.com/junegunn/fzf / WaitFor

Method WaitFor

src/util/eventbox.go:83–96  ·  view source on GitHub ↗

WaitFor blocks the execution until the event is received

(event EventType)

Source from the content-addressed store, hash-verified

81
82// WaitFor blocks the execution until the event is received
83func (b *EventBox) WaitFor(event EventType) {
84 looping := true
85 for looping {
86 b.Wait(func(events *Events) {
87 for evt := range *events {
88 switch evt {
89 case event:
90 looping = false
91 return
92 }
93 }
94 })
95 }
96}

Callers 3

TestReadFromCommandFunction · 0.95
RunFunction · 0.95
LoopMethod · 0.80

Calls 1

WaitMethod · 0.95

Tested by 1

TestReadFromCommandFunction · 0.76