RACSubscriber Protocol Reference
Conforms to | NSObject |
Declared in | RACSubscriber.h |
Overview
Represents any object which can directly receive values from a RACSignal.
You generally shouldn’t need to implement this protocol. [RACSignal createSignal:], RACSignal’s subscription methods, or RACSubject should work for most uses.
Implementors of this protocol may receive messages and values from multiple threads simultaneously, and so should be thread-safe. Subscribers will also be weakly referenced so implementations must allow that.
Tasks
-
– sendNext:
required method -
– sendError:
required method -
– sendCompleted
required method -
– didSubscribeWithDisposable:
required method
Instance Methods
didSubscribeWithDisposable:
Sends the subscriber a disposable that represents one of its subscriptions.
- (void)didSubscribeWithDisposable:(RACDisposable *)disposable
Discussion
A subscriber may receive multiple disposables if it gets subscribed to multiple signals; however, any error or completed events must terminate all subscriptions.
Declared In
RACSubscriber.h
sendCompleted
Send completed to subscribers.
- (void)sendCompleted
Discussion
This terminates the subscription, and invalidates the subscriber (such that it cannot subscribe to anything else in the future).
Declared In
RACSubscriber.h