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

Switch to Cold Observables #56

Merged
merged 4 commits into from
Oct 12, 2014
Merged

Switch to Cold Observables #56

merged 4 commits into from
Oct 12, 2014

Conversation

anaisbetts
Copy link
Member

This PR switches the IObservable implementation to one that returns Cold Observables. This is a breaking change for 2.0:

Before:

var observable = someRestService.ReturnsAnObservable();
var result1 = await observable;
var result2 = await observable;

// result2 is just a replayed result1, the network request was made when
// we called ReturnsAnObservable regardless if anyone cared.
result1 == result2;
>>> true

After:

// Does nothing
var observable = someRestService.ReturnsAnObservable();

// Makes a web request
var result1 = await observable;

// Makes a *different* web request
var result2 = await observable;

result1 == result2;
>>> maybe?

Web requests created via Observables can be preemptively canceled via unsubscribing to the Observable (unlike the Task-based methods, which currently don't support Cancellation)

Closes #50

anaisbetts pushed a commit that referenced this pull request Oct 12, 2014
Switch to Cold Observables
@anaisbetts anaisbetts merged commit 6ce3191 into master Oct 12, 2014
@anaisbetts anaisbetts deleted the cold-io branch October 12, 2014 05:06
@lock lock bot locked and limited conversation to collaborators Jun 25, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant