Wednesday, May 6, 2015

INTQ Rx


Explain various ISchedulers
.Immediate  --- Single Threaded
.CurrentThread  -- Single Threaded + Msq Q for chain nest
.NewThread  -- EventLoopScheduler of its own
.TaskPool/ThreadPool --- out of order
.EventLoopScheduler  --- true multi-threading Func<ThreadStart,Thread> !=CurrentThread
.DispatcherScheduler --pitfall, .instance=> new instance not started

Explain IObservable<int> Publish/Connect extension methods?
How this compare to Lazy<T> vs. List<T>
When this can lose some data ? ( subscribe after connect.

How Publish will allow subscribe all has the same set of data?
Why .RefCount() is better?
Auto Connect +eagar dispose();

CompareSubscribeSafe vs. Subcribe.Subscribe()?
translate Synchronous Exception to OnError

How do you use Observable.FromEventPatterh?
Observable.FromEventPattern<EventHandler, EventArgs>

What  SelectMany does when using Buffer(2,2)?
(0,1,2,...)=>((0,1),(3,4)..) flattern 

What does CombineLatest return?
a list

Compare Zip vs. Merge? How Cancat fit in?
Different Type needs Func to map, same type.

How do you use Any, All, Contain?

How do you use Distinct, DistinctUntilChanged, Skip, SkilUntil, Take, TakeUntil?

How to generate Observable<T> as Test data?
 IEnumerable<IObservable<long>> getSeq()
{
  yield return Observable.Create<long>( obsr => {
               return Observable.Timer(TimeSpan.FromSeconds(1)). select (i=>1L)
                     .subscribe(obsr)
               });
 }

What is a Subject?
observer and Observable

How do u use StartWith?
Concat at 1st place

Compare Merge, Amb, Switch?
Ambigous io1,io2,io3.. first reponded turn off others
Switch switch the most recent io, turn off others. e.g. search box narrow down.





No comments: