Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
RxJava での Observable のつくりかた
Search
Pine Mizune
November 18, 2015
Programming
160
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
RxJava での Observable のつくりかた
社内 ReactiveX 勉強会での発表資料
ソースコード:
https://github.com/pine613/rxnight
Pine Mizune
November 18, 2015
More Decks by Pine Mizune
See All by Pine Mizune
多言語対応と絵文字ジェネレーター / i18n of Emoji Generator
pine
0
900
C++ 製グラフィックライブラリ Skia の紹介 / Introduction to the graphics library Skia written by C++
pine
0
2k
asyncio + aiohttp で作るウェブサービス / How to develop a web service with asyncio and aiohttp
pine
0
710
Lerna による明示的疎結合アーキテクチャ
pine
1
690
CircleCI 2.0 x JavaScript
pine
3
580
Perl 卒業式
pine
0
380
Android Studio の気になる warnings を抑制する方法まとめ
pine
0
540
Emoji Generator meets Browser Extensions
pine
1
3k
近年の OSS 開発における CI 選択のベストプラクティス
pine
3
4.5k
Other Decks in Programming
See All in Programming
個人開発基盤をまるごとCloudflareに引っ越して爆速で総合的体験を向上させた話
tinykitten
0
200
Augmenting AI with the Power of Jakarta EE
ivargrimstad
0
290
JRuby: Past, Present, and Future
headius
0
190
速習iPhone Duo対応
yuukiw00w
1
710
thread_parallel_with_free-threaded_Python_and_NumPy.pdf
riku_sakamoto
0
350
AI が書く Go コードの品質を劇的に向上させる Linter: “declscope”
mpyw
0
380
Starting & Sustaining Code-Based E2E Testing for Non-Coding QA Teams( #jasstniigata )
teyamagu
PRO
1
500
モデルのリファクタリングが難しいと思ったら、そもそも複雑だったのはビジネス仕様だった ? / is-the-business-domain-the-real-complexity
hatsu38
0
390
Webの地図
yosuke_furukawa
PRO
6
4.7k
ゲームコントローラやキーボードのファームウェアをSwiftで書く
kishikawakatsumi
1
250
iOSDC2026登壇資料.pdf
riofujimon
0
180
一人だけ、Kiroが静止する日
hideg
0
130
Featured
See All Featured
Money Talks: Using Revenue to Get Sh*t Done
nikkihalliwell
0
500
State of Search Keynote: SEO is Dead Long Live SEO
ryanjones
0
280
The innovator’s Mindset - Leading Through an Era of Exponential Change - McGill University 2025
jdejongh
PRO
1
340
Accessibility Awareness
sabderemane
1
220
AI Search: Where Are We & What Can We Do About It?
aleyda
0
8k
Improving Core Web Vitals using Speculation Rules API
sergeychernyshev
21
1.6k
The Psychology of Web Performance [Beyond Tellerrand 2023]
tammyeverts
49
3.6k
The Language of Interfaces
destraynor
162
27k
The AI Search Optimization Roadmap by Aleyda Solis
aleyda
1
6.2k
Sharpening the Axe: The Primacy of Toolmaking
bcantrill
46
3k
SEOcharity - Dark patterns in SEO and UX: How to avoid them and build a more ethical web
sarafernandez
0
280
Why Mistakes Are the Best Teachers: Turning Failure into a Pathway for Growth
auna
0
290
Transcript
RxJava での Observable のつくりかた Pine Mizune
もくじ • just • empty • from • range •
repeat • create
ソースコードはこちら • Java 7 ~ • ./gradlew run • https://github.com/pine613/rxnight
just (1/2) Observable .just("yano") .subscribe(new Action1<String>() { @Override public void
call(String name) { // Hello yano System.out.println("Hello, " + name + "!"); } });
just (2/2) Observable.create(new Observable.OnSubscribe<String>() { @Override public void call(final Subscriber<?
super String> observer) { observer.onNext("yano"); observer.onCompleted(); } }).subscribe(new Action1<String>() { @Override public void call(String name) { System.out.println("Hello, " + name + "!"); // Hello yano } });
empty Observable.<String>empty().doOnCompleted(new Action0() { @Override public void call() { System.out.println("Completed");
} }).subscribe(new Action1<String>() { @Override public void call(String name) { // not performed ... System.out.println("Hello, " + name + "!"); } });
range Observable .range(1, 10) .subscribe(new Action1<Integer>() { @Override public void
call(Integer value) { System.out.println(value); // 1, 2, ..., 10 } });
range Observable.range(1, 10).map(new Func1<Integer, Integer>() { @Override public Integer call(Integer
value) { return value * 2; // 2, 4, 6, ... } }) .reduce(0, new Func2<Integer, Integer, Integer>() { // sum @Override public Integer call(Integer sum, Integer value) { return sum + value; } }).subscribe(new Action1<Integer>() { @Override public void call(Integer value) { System.out.println(value); // 110 } });
repeat (1/2) Observable .just(1) .repeat(3) .subscribe(new Action1<Integer>() { @Override public
void call(Integer value) { System.out.println(value); // 1, 1, 1 } });
repeat (2/2) Observable .from(new Boolean[]{ true, false }) .repeat(3) .subscribe(new
Action1<Boolean>() { @Override public void call(Boolean value) { System.out.println(value); // true, false, ... } });
create (1/2) Observable<Integer> random = Observable.create( new Observable.OnSubscribe<Integer>() { @Override
public void call(final Subscriber<? super Integer> observer) { Random random = new Random(); observer.onNext(random.nextInt(10)); // 0 ~ 9 observer.onCompleted(); } });
create (2/2) Observable<Integer> random = Observable.create(new Observable.OnSubscribe<Integer>() { @Override public
void call(final Subscriber<? super Integer> observer) { Random random = new Random(); observer.onNext(random.nextInt(10)); // 0 ~ 9 observer.onCompleted(); } }); random.repeat().take(10).subscribe(new Action1<Integer>() { @Override public void call(Integer value) { System.out.println(value); // 7, 0, 8, ... } });
THANKS