*/
@Override
public void subscribe(final Subscriber<? super O> subscriber) {
try {
final NonBlocking asyncSubscriber = NonBlocking.class.isAssignableFrom(subscriber.getClass()) ?
(NonBlocking) subscriber :
null;
final PushSubscription<O> subscription = createSubscription(subscriber,
(null == asyncSubscriber || asyncSubscriber.getDispatcher() != dispatcher || asyncSubscriber.getCapacity() <
capacity)
);
if (subscription == null)
return;
if (null != asyncSubscriber) {
subscription.maxCapacity(asyncSubscriber.getCapacity());
}
subscribeWithSubscription(subscriber, subscription, asyncSubscriber == null);
} catch (Exception e) {