MCPcopy Create free account
hub / github.com/ReactiveX/RxGo / getChannel

Function getChannel

observable_operator_random_test.go:124–135  ·  view source on GitHub ↗
(ctx context.Context)

Source from the content-addressed store, hash-verified

122}
123
124func getChannel(ctx context.Context) chan Item {
125 ch := make(chan Item, 3)
126 go func() {
127 time.Sleep(randomTime())
128 Of(1).SendContext(ctx, ch)
129 time.Sleep(randomTime())
130 Of(2).SendContext(ctx, ch)
131 time.Sleep(randomTime())
132 Of(3).SendContext(ctx, ch)
133 }()
134 return ch
135}
136
137func randomTime() time.Duration {
138 return time.Duration(rand.Intn(maxSleepNs)) * time.Nanosecond

Callers 1

TestLeakFunction · 0.85

Calls 3

randomTimeFunction · 0.85
OfFunction · 0.85
SendContextMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…