@@ -12,7 +12,7 @@ import (
1212// to emit an item or notification.
1313func Amb (observables []Observable , opts ... Option ) Observable {
1414 option := parseOptions (opts ... )
15- ctx := option .buildContext ()
15+ ctx := option .buildContext (emptyContext )
1616 next := option .buildChannel ()
1717 once := sync.Once {}
1818
@@ -65,7 +65,7 @@ func Amb(observables []Observable, opts ...Option) Observable {
6565// and emit items based on the results of this function.
6666func CombineLatest (f FuncN , observables []Observable , opts ... Option ) Observable {
6767 option := parseOptions (opts ... )
68- ctx := option .buildContext ()
68+ ctx := option .buildContext (emptyContext )
6969 next := option .buildChannel ()
7070
7171 go func () {
@@ -130,7 +130,7 @@ func CombineLatest(f FuncN, observables []Observable, opts ...Option) Observable
130130// Concat emits the emissions from two or more Observables without interleaving them.
131131func Concat (observables []Observable , opts ... Option ) Observable {
132132 option := parseOptions (opts ... )
133- ctx := option .buildContext ()
133+ ctx := option .buildContext (emptyContext )
134134 next := option .buildChannel ()
135135
136136 go func () {
@@ -186,7 +186,10 @@ func Empty() Observable {
186186
187187// FromChannel creates a cold observable from a channel.
188188func FromChannel (next <- chan Item , opts ... Option ) Observable {
189+ option := parseOptions (opts ... )
190+ ctx := option .buildContext (emptyContext )
189191 return & ObservableImpl {
192+ parent : ctx ,
190193 iterable : newChannelIterable (next , opts ... ),
191194 }
192195}
@@ -196,7 +199,7 @@ func FromEventSource(next <-chan Item, opts ...Option) Observable {
196199 option := parseOptions (opts ... )
197200
198201 return & ObservableImpl {
199- iterable : newEventSourceIterable (option .buildContext (), next , option .getBackPressureStrategy ()),
202+ iterable : newEventSourceIterable (option .buildContext (emptyContext ), next , option .getBackPressureStrategy ()),
200203 }
201204}
202205
@@ -205,7 +208,7 @@ func FromEventSource(next <-chan Item, opts ...Option) Observable {
205208func Interval (interval Duration , opts ... Option ) Observable {
206209 option := parseOptions (opts ... )
207210 next := option .buildChannel ()
208- ctx := option .buildContext ()
211+ ctx := option .buildContext (emptyContext )
209212
210213 go func () {
211214 i := 0
@@ -246,7 +249,7 @@ func JustItem(item interface{}, opts ...Option) Single {
246249// Merge combines multiple Observables into one by merging their emissions
247250func Merge (observables []Observable , opts ... Option ) Observable {
248251 option := parseOptions (opts ... )
249- ctx := option .buildContext ()
252+ ctx := option .buildContext (emptyContext )
250253 next := option .buildChannel ()
251254 wg := sync.WaitGroup {}
252255 wg .Add (len (observables ))
@@ -311,7 +314,7 @@ func Range(start, count int, opts ...Option) Observable {
311314func Start (fs []Supplier , opts ... Option ) Observable {
312315 option := parseOptions (opts ... )
313316 next := option .buildChannel ()
314- ctx := option .buildContext ()
317+ ctx := option .buildContext (emptyContext )
315318
316319 go func () {
317320 defer close (next )
@@ -343,7 +346,7 @@ func Thrown(err error) Observable {
343346func Timer (d Duration , opts ... Option ) Observable {
344347 option := parseOptions (opts ... )
345348 next := make (chan Item , 1 )
346- ctx := option .buildContext ()
349+ ctx := option .buildContext (emptyContext )
347350
348351 go func () {
349352 defer close (next )
0 commit comments