Skip to content

Commit

Permalink
Removed race condition from example
Browse files Browse the repository at this point in the history
  • Loading branch information
Froussios committed Jul 4, 2015
1 parent be30658 commit eb6cac0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Part 3 - Taming the sequence/6. Hot and Cold observables.md
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ var period = TimeSpan.FromSeconds(1);
var observable = Observable.Interval(period).Publish();
observable.Connect();
observable.Subscribe(i => Console.WriteLine("first subscription : {0}", i));
Thread.Sleep(period);
Thread.Sleep(period + TimeSpan.FromMilliseconds(50));
observable.Subscribe(i => Console.WriteLine("second subscription : {0}", i));
```

Expand All @@ -179,7 +179,7 @@ In the example above, the observable variable is an `IConnectableObservable<T>`,
var period = TimeSpan.FromSeconds(1);
var observable = Observable.Interval(period).Publish();
observable.Subscribe(i => Console.WriteLine("first subscription : {0}", i));
Thread.Sleep(period);
Thread.Sleep(period + TimeSpan.FromMilliseconds(50));
observable.Subscribe(i => Console.WriteLine("second subscription : {0}", i));
observable.Connect();
```
Expand Down

0 comments on commit eb6cac0

Please sign in to comment.