On Github Jiri-Kremser / rx-devconf-presentation
Jiří Kremser < jkremser(at)redhat.com >
#hawkular on Freenode
2016-01-27public void getData(Callback<T> callMeMaybe);
public Future<T> getData();
public Future<List<Future<T>>> getData();
public Observable<T> getData();
() => Future[Try[Option[T]]]
T next()
onNext(T)
throws new Exception();
onError(Exception)
return;
onCompleted()(onNext)*(onError|onCompleted)?
Stream.of(3, 1, 4, 1, 5, 9, 2) .flatMap(x -> Stream.of(x, x)) .map(x -> x * 2) .filter(x -> x > new Random().nextInt(9));vs
Observable.just(3, 1, 4, 1, 5, 9, 2) .flatMap(x -> Observable.just(x, x)) .map(x -> x * 2) .filter(x -> x > new Random().nextInt(9));
Observable.interval(1, TimeUnit.SECONDS) .subscribe(System.out::println);
Observable.interval(1, TimeUnit.SECONDS) .subscribe(println(_))
Observable.interval(1, TimeUnit.SECONDS) .subscribe{println it}
Observable.interval(1, TimeUnit.SECONDS) .subscribe {|val| puts val}
(-> (Observable/interval 1 TimeUnit/SECONDS) (.subscribe (fn [arg] (println arg))))
Observable.Interval(TimeSpan.FromSeconds(1)) .Subscribe(x => Console.WriteLine(x));
rx::observable<>::interval(std::chrono::seconds(1)) .subscribe( [](long v){std::cout << v;}, [](){std::cout << "OnCompleted";} )
Observable.interval(1000) .subscribe(lambda x: print x)
\Rx\Observable::interval(1000, $scheduler) ->subscribe(function ($x) { echo $x; });
const wsUri = 'wss://echo.websocket.org'; Rx.Observable .webSocket(wsUri) .filter((e) => e.topic === 'kittens') .subscribe((e) => console.log(e));
const wsUri = 'wss://echo.websocket.org'; Rx.Observable .webSocket(wsUri) .groupBy((e) => e.topic) .subscribe((e) => console.log(e));
it('should filter in only prime numbers', function () { var source = hot('-1--2--^-3-4-5-6--7-8--9--|'); var subs = '^ !'; var expected = '--3---5----7-------|'; expectObservable(source.filter(isPrime)).toBe(expected); expectSubscriptions(source.subscriptions).toBe(subs); });(link) More of it here.
This presentation
Jiří Kremser