public static ISingle <T> OnErrorReturn <T>(this ISingle <T> source, Func <T> valueSupplier) { return(Create <T>(s => { source.Subscribe(new OnErrorReturnSingleSubscriber <T>(s, valueSupplier)); })); }
public static ISingle <T> OnErrorResumeNext <T>(this ISingle <T> source, Func <Exception, ISingle <T> > resumeWith) { return(Create <T>(s => { source.Subscribe(new ResumeNextSingleSubscriber <T>(s, resumeWith)); })); }
public static ISingle <T> Timeout <T>(this ISingle <T> source, TimeSpan timeout, IScheduler scheduler, ISingle <T> other = null) { return(Create <T>(s => { source.Subscribe(new TimeoutSingleSubscriber <T>(s, timeout, scheduler, other)); })); }
public static ISingle <T> Delay <T>(this ISingle <T> source, TimeSpan delay, IScheduler scheduler, bool delayError = false) { return(Create <T>(s => { source.Subscribe(new DelaySingeSubscriber <T>(s, delay, scheduler, delayError)); })); }
public static ISingle <T> UnsubscribeOn <T>(this ISingle <T> source, IScheduler scheduler) { return(Create <T>(s => { source.Subscribe(new UnsubscribeOnSingleSubscriber <T>(s, scheduler)); })); }
public static ISingle <R> Map <T, R>(this ISingle <T> source, Func <T, R> mapper) { return(Create <R>(s => { source.Subscribe(new MapSingleSubscriber <T, R>(s, mapper)); })); }
public static T Get <T>(this ISingle <T> source, TimeSpan timeout) { LatchedSingleSubscriber <T> lss = new LatchedSingleSubscriber <T>(); source.Subscribe(lss); return(lss.Get(timeout)); }
public static T Get <T>(this ISingle <T> source) { LatchedSingleSubscriber <T> lss = new LatchedSingleSubscriber <T>(); source.Subscribe(lss); return(lss.Get()); }
public static IDisposable Subscribe <T>(this ISingle <T> source) { LambdaSingleSubscriber <T> lss = new LambdaSingleSubscriber <T>(v => { }, e => { }); source.Subscribe(lss); return(lss); }
public IDisposable Subscribe(IObserver <T> observer) { ObserverToSingleSubscriber <T> oss = new ObserverToSingleSubscriber <T>(observer); source.Subscribe(oss); return(oss); }
public static IDisposable Subscribe <T>(this ISingle <T> source, IObserver <T> observer) { ObserverToSingleSubscriber <T> oss = new ObserverToSingleSubscriber <T>(observer); source.Subscribe(oss); return(oss); }
public static ISingle <T> DoOnError <T>(this ISingle <T> source, Action <Exception> onErrorCall) { return(Create <T>(s => { source.Subscribe(new LifecycleSingleSubscriber <T>(s, d => { }, v => { }, onErrorCall, () => { } )); })); }
public static ISingle <T> DoOnSuccess <T>(this ISingle <T> source, Action <T> onSuccessCall) { return(Create <T>(s => { source.Subscribe(new LifecycleSingleSubscriber <T>(s, d => { }, onSuccessCall, e => { }, () => { } )); })); }
public static ISingle <T> DoOnSubscribe <T>(this ISingle <T> source, Action <IDisposable> onSubscribeCall) { return(Create <T>(s => { source.Subscribe(new LifecycleSingleSubscriber <T>(s, onSubscribeCall, v => { }, e => { }, () => { } )); })); }
public static ICompletable ToCompletable <T>(this ISingle <T> source) { return(Completable.Create(cs => { SingleSubscriberToCompletableSubscriber <T> sscs = new SingleSubscriberToCompletableSubscriber <T>(cs); source.Subscribe(sscs); })); }
public static ISingle <T> DoAfterTerminate <T>(this ISingle <T> source, Action onAfterTerminateCall) { return(Create <T>(s => { source.Subscribe(new LifecycleSingleSubscriber <T>(s, d => { }, v => { }, e => { }, onAfterTerminateCall )); })); }
internal void Resubscribe() { if (Interlocked.Increment(ref wip) == 1) { do { source.Subscribe(this); } while (Interlocked.Decrement(ref wip) != 0); } }
public static IPublisher <T> ToPublisher <T>(this ISingle <T> source) { if (source is ScalarSource <T> ) { return((ScalarSource <T>)source); } return(Flowable.Create <T>(s => { source.Subscribe(new SubscriberToSingleSubscriber <T>(s)); })); }
internal void Resubscribe() { if (Interlocked.Increment(ref wip) == 1) { do { if (--remaining <= 0) { return; } source.Subscribe(this); } while (Interlocked.Decrement(ref wip) != 0); } }
public static ISingle <bool> Equals <T>(this ISingle <T> first, ISingle <T> second) { return(Create <bool>(s => { T[] array = new T[2]; int[] counter = { 2 }; SetCompositeDisposable all = new SetCompositeDisposable(); s.OnSubscribe(all); first.Subscribe(new EqualsSingleSubscriber <T>(s, 0, array, counter, all)); second.Subscribe(new EqualsSingleSubscriber <T>(s, 1, array, counter, all)); })); }
public static ISingle <T> SubscribeOn <T>(this ISingle <T> source, IScheduler scheduler) { return(Create <T>(s => { MultipleAssignmentDisposable inner = new MultipleAssignmentDisposable(); MultipleAssignmentDisposable mad = new MultipleAssignmentDisposable(inner); inner.Set(scheduler.ScheduleDirect(() => { source.Subscribe(new SingleSubscriberWrapper <T>(s, mad)); })); })); }
public void Subscribe(ISingleSubscriber <R> s) { ISingleSubscriber <T> sr; try { sr = onLift(s); } catch (Exception ex) { EmptyDisposable.Error(s, ex); return; } source.Subscribe(sr); }
public static ISingle <T> DelaySubscription <T>(this ISingle <T> source, TimeSpan delay, IScheduler scheduler) { return(Create <T>(s => { MultipleAssignmentDisposable inner = new MultipleAssignmentDisposable(); MultipleAssignmentDisposable mad = new MultipleAssignmentDisposable(inner); s.OnSubscribe(mad); inner.Set(scheduler.ScheduleDirect(() => { source.Subscribe(new SingleSubscriberWrapper <T>(s, mad)); }, delay)); })); }
void DoSubscribe() { source.Subscribe(this); }
public static void Subscribe <T>(this ISingle <T> source, ISubscriber <T> subscriber) { source.Subscribe(new SubscriberToSingleSubscriber <T>(subscriber)); }
public static ISingle <T> AsSingle <T>(this ISingle <T> source) { return(Create <T>(s => source.Subscribe(s))); }
public void OnComplete() { second.Subscribe(this); }