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

Function customObservableOperator

observable.go:104–121  ·  view source on GitHub ↗
(parent context.Context, f func(ctx context.Context, next chan Item, option Option, opts ...Option), opts ...Option)

Source from the content-addressed store, hash-verified

102}
103
104func customObservableOperator(parent context.Context, f func(ctx context.Context, next chan Item, option Option, opts ...Option), opts ...Option) Observable {
105 option := parseOptions(opts...)
106 next := option.buildChannel()
107 ctx := option.buildContext(parent)
108
109 if option.isEagerObservation() {
110 go f(ctx, next, option, opts...)
111 return &ObservableImpl{iterable: newChannelIterable(next)}
112 }
113
114 return &ObservableImpl{
115 iterable: newFactoryIterable(func(propagatedOptions ...Option) <-chan Item {
116 mergedOptions := append(opts, propagatedOptions...)
117 go f(ctx, next, option, mergedOptions...)
118 return next
119 }),
120 }
121}
122
123type operator interface {
124 next(ctx context.Context, item Item, dst chan<- Item, operatorOptions operatorOptions)

Callers 8

BufferWithTimeMethod · 0.85
BufferWithTimeOrCountMethod · 0.85
DebounceMethod · 0.85
FlatMapMethod · 0.85
JoinMethod · 0.85
TimeIntervalMethod · 0.85
WindowWithTimeMethod · 0.85
WindowWithTimeOrCountMethod · 0.85

Calls 6

parseOptionsFunction · 0.85
newChannelIterableFunction · 0.85
newFactoryIterableFunction · 0.85
buildChannelMethod · 0.65
buildContextMethod · 0.65
isEagerObservationMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…