Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Provide unsafeCreate, create and multicast Observable builders #96

Closed
alexandru opened this Issue Dec 29, 2015 · 1 comment

Comments

Projects
None yet
1 participant
@alexandru
Copy link
Member

commented Dec 29, 2015

Builder changes:

  1. the current Observable.create is unsafe and is renamed to Observable.unsafeCreate
  2. a new safer Observable.create is provided that works with concurrent/synchronous observers
  3. an Observable.multicast operator is provided, that takes as parameter the new MulticastStrategy enum

(1) The behavior of Observable.unsafeCreate will be different than the old Observable.create. Because the internal implementation of Monix stopped using this builder internally, we can now make it safer by wrapping the provided subscriber into an implementation that guards against grammar violations (after onComplete/onError are final and the data source should not send any other onNext events). Synchronous exceptions thrown are also redirected to onError. However it will still not guard against asynchronous errors or against back-pressure violations.

(2) The new Observable.create takes as parameter an OverflowStrategy.Synchronous, since it is backed by an underlying buffer. This will be the alternative for creating observables for which we cannot back-pressure the source, but without sharing the data-source between multiple subscribers (cold/unicast, not hot/multicast).

(3) the Observable.multicast builder will return an input-output pair, being the preferred method of building a hot data-source, instead of working with subjects directly.

@alexandru alexandru added this to the 2.0 milestone Dec 29, 2015

alexandru added a commit that referenced this issue Dec 29, 2015

@alexandru alexandru self-assigned this Dec 29, 2015

@alexandru alexandru changed the title Rename Observable.create in Observable.unsafeCreate Get rid of Observable.unsafeCreate Mar 15, 2016

@alexandru alexandru changed the title Get rid of Observable.unsafeCreate Get rid of Observable.create Mar 15, 2016

@alexandru alexandru closed this Mar 18, 2016

@alexandru alexandru changed the title Get rid of Observable.create Provide unsafeCreate, create and multicast Observable builders Mar 21, 2016

@alexandru alexandru reopened this Mar 21, 2016

alexandru added a commit that referenced this issue Mar 22, 2016

@alexandru alexandru changed the title Provide unsafeCreate, create and multicast Observable builders Provide unsafeCreate and create Observable builders Jun 29, 2016

@alexandru alexandru changed the title Provide unsafeCreate and create Observable builders Provide unsafeCreate, create and multicast Observable builders Jun 29, 2016

@alexandru

This comment has been minimized.

Copy link
Member Author

commented Jun 29, 2016

Already on master.

@alexandru alexandru closed this Jun 29, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.