RACMulticastConnection Class Reference
Inherits from | NSObject |
Declared in | RACMulticastConnection.h RACMulticastConnection.m |
Overview
A multicast connection encapsulates the idea of sharing one subscription to a signal to many subscribers. This is most often needed if the subscription to the underlying signal involves side-effects or shouldn’t be called more than once.
The multicasted signal is only subscribed to when
[RACMulticastConnection connect] is called. Until that happens, no values
will be sent on signal
. See [RACMulticastConnection autoconnect] for how
[RACMulticastConnection connect] can be called automatically.
Note that you shouldn’t create RACMulticastConnection manually. Instead use [RACSignal publish] or [RACSignal multicast:].
Instance Methods
autoconnect
Connects to the underlying signal when the returned signal is first subscribed to, and disposes of the subscription to the multicasted signal when the returned signal has no subscribers.
- (RACSignal *)autoconnect
Discussion
If new subscribers show up after being disposed, they’ll subscribe and then be immediately disposed of. The returned signal will never reconnect to the multicasted signal.
Returns the autoconnecting signal.
Declared In
RACMulticastConnection.h