MCPcopy Index your code
hub / github.com/ReactiveX/RxGo / Observe

Method Observe

iterable_create.go:34–52  ·  view source on GitHub ↗
(opts ...Option)

Source from the content-addressed store, hash-verified

32}
33
34func (i *createIterable) Observe(opts ...Option) <-chan Item {
35 mergedOptions := append(i.opts, opts...)
36 option := parseOptions(mergedOptions...)
37
38 if !option.isConnectable() {
39 return i.next
40 }
41
42 if option.isConnectOperation() {
43 i.connect(option.buildContext(emptyContext))
44 return nil
45 }
46
47 ch := option.buildChannel()
48 i.mutex.Lock()
49 i.subscribers = append(i.subscribers, ch)
50 i.mutex.Unlock()
51 return ch
52}
53
54func (i *createIterable) connect(ctx context.Context) {
55 i.mutex.Lock()

Callers

nothing calls this directly

Calls 6

connectMethod · 0.95
parseOptionsFunction · 0.85
isConnectableMethod · 0.65
isConnectOperationMethod · 0.65
buildContextMethod · 0.65
buildChannelMethod · 0.65

Tested by

no test coverage detected