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

Function Test_Observable_Map_Parallel

observable_operator_test.go:1280–1297  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

1278}
1279
1280func Test_Observable_Map_Parallel(t *testing.T) {
1281 defer goleak.VerifyNone(t)
1282 ctx, cancel := context.WithCancel(context.Background())
1283 defer cancel()
1284 const len = 10
1285 ch := make(chan Item, len)
1286 go func() {
1287 for i := 0; i < len; i++ {
1288 ch <- Of(i)
1289 }
1290 close(ch)
1291 }()
1292
1293 obs := FromChannel(ch).Map(func(_ context.Context, i interface{}) (interface{}, error) {
1294 return i.(int) + 1, nil
1295 }, WithPool(len))
1296 Assert(ctx, t, obs, HasItemsNoOrder(1, 2, 3, 4, 5, 6, 7, 8, 9, 10), HasNoError())
1297}
1298
1299func Test_Observable_Marshal(t *testing.T) {
1300 defer goleak.VerifyNone(t)

Callers

nothing calls this directly

Calls 7

OfFunction · 0.85
FromChannelFunction · 0.85
WithPoolFunction · 0.85
AssertFunction · 0.85
HasItemsNoOrderFunction · 0.85
HasNoErrorFunction · 0.85
MapMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…