Serialize Operator

February 25, 2020 ยท View on GitHub

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