(parent context.Context, f func(ctx context.Context, next chan Item, option Option, opts ...Option), opts ...Option)
| 102 | } |
| 103 | |
| 104 | func 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 | |
| 123 | type operator interface { |
| 124 | next(ctx context.Context, item Item, dst chan<- Item, operatorOptions operatorOptions) |
no test coverage detected
searching dependent graphs…