MCPcopy Index your code
hub / github.com/riverqueue/river / waitOrTimeout

Function waitOrTimeout

example_queue_pause_test.go:113–120  ·  view source on GitHub ↗
(ch <-chan T)

Source from the content-addressed store, hash-verified

111}
112
113func waitOrTimeout[T any](ch <-chan T) T {
114 select {
115 case item := <-ch:
116 return item
117 case <-time.After(5 * time.Second):
118 panic("WaitOrTimeout timed out after waiting 5s")
119 }
120}

Callers 1

Example_queuePauseFunction · 0.85

Calls 1

AfterMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…