public void Subscribe(ISignalObserver <T> observer) { if (serialize) { var parent = new CreateDisposableSerializedEmitter(observer); observer.OnSubscribe(parent); try { onSubscribe(parent); } catch (Exception ex) { parent.OnError(ex); } } else { var parent = new CreateDisposableEmitter(observer); observer.OnSubscribe(parent); try { onSubscribe(parent); } catch (Exception ex) { parent.OnError(ex); } } }
public IDisposable Subscribe(IObserver <T> observer) { if (serialize) { var parent = new CreateDisposableSerializedEmitter(observer); try { onSubscribe(parent); } catch (Exception ex) { parent.OnError(ex); } return(parent); } else { var parent = new CreateDisposableEmitter(observer); try { onSubscribe(parent); } catch (Exception ex) { parent.OnError(ex); } return(parent); } }