Skip to content

Latest commit

 

History

History
42 lines (27 loc) · 954 Bytes

serialize.md

File metadata and controls

42 lines (27 loc) · 954 Bytes

Serialize Operator

Overview

Force an Observable to make serialized calls and to be well-behaved. It takes the starting index and a function that transforms an item value into an index.

Example

observable := rxgo.Range(0, 1_000_000, rxgo.WithBufferedChannel(capacity)).
	Map(func(_ context.Context, i interface{}) (interface{}, error) {
		return i, nil
	}, rxgo.WithCPUPool(), rxgo.WithBufferedChannel(capacity)).
	Serialize(0, func(i interface{}) int {
		return i.(int)
	})

Output:

true

Options