Configure the capacity of the output channel.
rxgo.WithBufferedChannel(1) // Create a buffered channel with a 1 capacity
Allows passing a context. The Observable will listen to its done signal to close itself.
rxgo.WithContext(ctx)
- Lazy (default): consume when an Observer starts to subscribe.
rxgo.WithObservation(rxgo.Lazy)
- Eager: consumer when the Observable is created:
rxgo.WithObservation(rxgo.Eager)
- Stop (default): stop processing if the Observable produces an error.
rxgo.WithErrorStrategy(rxgo.Stop)
- Continue: continue processing items if the Observable produces an error.
rxgo.WithErrorStrategy(rxgo.Continue)
This strategy is propagated to the parent(s) Observable(s).
Convert the operator in a parallel operator and specify the number of concurrent goroutines.
rxgo.WithPool(8) // Creates a pool of 8 goroutines
Convert the operator in a parallel operator and specify the number of concurrent goroutines as runtime.NumCPU()
.
rxgo.WithCPUPool()