Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
2016/05/16 adtech x scala meetup のLT
Search
Tomohisa Omagari
July 03, 2016
Programming
1
77
2016/05/16 adtech x scala meetup のLT
Tomohisa Omagari
July 03, 2016
Tweet
Share
More Decks by Tomohisa Omagari
See All by Tomohisa Omagari
事業貢献を考えるための技術改善の目標設計と改善実績 / Targeted design of technical improvements to consider business contribution and improvement performance
oomatomo
0
96
プロダクト開発の貢献をアピールするための目標設計や認知活動 / Goal design and recognition activities to promote product development contributions.
oomatomo
5
1.3k
多様性のあるプロダクトチームを目指した共創の3年間の変化 / Three Years of Co-Creation for Diverse Product Teams Change
oomatomo
1
98
事業貢献を見据えた モダナイゼーションへの挑戦
oomatomo
1
58
UXへの投資と組織変革 ─ ビジネスに貢献するUXチームの飛躍 ─
oomatomo
1
43
Finagleを使った広告配信基盤
oomatomo
0
470
Finagleを使った Perl -> Scalaへの移行
oomatomo
0
1.9k
Other Decks in Programming
See All in Programming
あれやってみてー駆動から成長を加速させる / areyattemite-driven
nashiusagi
1
200
今年のアップデートで振り返るCDKセキュリティのシフトレフト/2024-cdk-security-shift-left
tomoki10
0
200
Zoneless Testing
rainerhahnekamp
0
120
Semantic Kernelのネイティブプラグインで知識拡張をしてみる
tomokusaba
0
180
Go の GC の不得意な部分を克服したい
taiyow
2
770
Haze - Real time background blurring
chrisbanes
1
510
Cloudflare MCP ServerでClaude Desktop からWeb APIを構築
kutakutat
1
540
テストコード文化を0から作り、変化し続けた組織
kazatohiei
2
1.5k
menu基盤チームによるGoogle Cloudの活用事例~Application Integration, Cloud Tasks編~
yoshifumi_ishikura
0
110
たのしいparse.y
ydah
3
120
バグを見つけた?それAppleに直してもらおう!
uetyo
0
180
複雑な仕様に立ち向かうアーキテクチャ
myohei
0
170
Featured
See All Featured
Six Lessons from altMBA
skipperchong
27
3.5k
A designer walks into a library…
pauljervisheath
204
24k
The World Runs on Bad Software
bkeepers
PRO
65
11k
Building Adaptive Systems
keathley
38
2.3k
Why You Should Never Use an ORM
jnunemaker
PRO
54
9.1k
Visualization
eitanlees
146
15k
10 Git Anti Patterns You Should be Aware of
lemiorhan
PRO
656
59k
Documentation Writing (for coders)
carmenintech
66
4.5k
How to train your dragon (web standard)
notwaldorf
88
5.7k
Making the Leap to Tech Lead
cromwellryan
133
9k
Understanding Cognitive Biases in Performance Measurement
bluesmoon
26
1.5k
What's in a price? How to price your products and services
michaelherold
243
12k
Transcript
ͳΔͬͯଟ͍ΑͶʁ
ࣗݾհ େۂஐٱ
͋Δػೳͷ ( D: σΟϨΫλʔɺE:ΤϯδχΞ) ▸ Dʮ͜ͷػೳɺཧը໘͕มߋ͞ΕͨΒߋ৽ͯ͠΄͍͠ɻ ɹɹ͋ͱɺؔ࿈͢Δσʔλมߋͯ͠΄͍͠ɻʯ ▸ Eʮ͜ͷػೳͷߋ৽සɺͲΕ͘Β͍ʹ͠·͢ʁʯ ▸
DʮͳΔͰʯ ▸ E ʮ10͝ͱͰ͍͍Ͱ͔͢ʁʯ ▸ Dʮ͏ʙΜɺͬͱͳΔͰʯ ▸ Eʮ̑ʯ ▸ Dʮ͏ʙΜɺͬͱͳΔͰʯ
͋Δػೳͷ ( D: σΟϨΫλʔɺE:ΤϯδχΞ) ▸ Eʮ̍ʯ ▸ Dʮ͏ʙΜɾɾɾɾʯ ▸ EʮϚδ͔ʯ
͋Δػೳͷ ( D: σΟϨΫλʔɺE:ΤϯδχΞ) ▸ E ʮ30ඵʯ(͏Ͳ͏ʹͰͳΕʣ ▸ Dʮ͓͓͓ʯ ▸
Eʮ10ඵʯ ▸ Dʮʯ ▸ Eʮ1ඵʯ ▸ Dʮ࠷ߴʯ
Θ͔͍ͬͯΔ͜ͱ ▸ όονॲཧͰͦ͠͏ ▸ ΩϡʔॲཧͰΕɺ͍ΖΜͳλΠϛϯάͰॲཧͰ͖ͦ͏ ▸ ॲཧ͕ॏෳ͠ͳ͍Α͏ʹ͢Δ
ઃܭͷΠϝʔδਤ
ઃܭͷΠϝʔδਤ ͜͜ͷ෦Λ࡞Δ
Γ͍ͨ͜ͱ ▸ όονॲཧͰɺݫ͍ͨ͠ΊσʔϞϯԽ͢Δ ▸ ͍͍ײ͡ʹΩϡʔॲཧͷ࣮ߦ࣌ؒΛมߋͰ͖Δ ▸ ΩϡʔॲཧͷछྨΛىಈ࣌ͷίϚϯυͰ ࢦఆͰ͖ΔΑ͏ʹ͍ͨ͠
ͬͨ͜ͱ ແݶϧʔϓ ▸ PerlͰ࣮͍ͯͨ͠Έ͍ͨʹ࣮ ▸ SIGTERMͷΩϟονͯ͠ ແݶϧʔϓΛऴྃͤ͞Δ
݁Ռ ແݶϧʔϓ ▸ ॲཧ͕࣌ʑɺ͖ͪΜͱऴྃͨ͠Γ͠ͳ͔ͬͨΓͨ͠ɻ (SIGTERM ͷνΣοΫ͕͓͔͔ͬͨ͠ͷ͔ɻɻ) ຖճͷ࠶ىಈ͕ා͔ͬͨɻɻ ▸ ࣗͰσʔϞϯͷϓϩηε͕ಈ͍͍ͯΔ͔ νΣοΫ͢Δඞཁ͕͋ͬͨ
▸ ৭ʑͱਏ͔ͬͨ
ͬͨ͜ͱ Play + akka scheduler ▸ PlayͷϞδϡʔϧͱͯ͠ ActorͷॲཧΛ࣮ߦ͢ΔΑ͏ʹͨ͠ ▸ Playͱͯ͠ͷػೳɺಛʹར༻͍ͯ͠ͳ͍
(Controllerͱ͔) ▸ ىಈ࣌ͷҾͰॲཧͷछྨΛมߋ
ͬͨ͜ͱ Play + akka scheduler
ͬͨ͜ͱ Play + akka scheduler ActorΛఀࢭ͢ΔλΠϓɺStopʹ͍ͯ͠Δ ཧ༝ɿϝοηʔδɺ͋͘·ͰॲཧΛ࣮ߦ͢ΔͨΊͷτϦΨʔͱׂͯ͠ PoisonPill Stop
ͬͨ͜ͱ Play + akka scheduler Actorͷઃఆ ɾϝοηʔδ͕ᷓΕͨΒແࢹ͢Δ ɾDead LetterΛແࢹ͢Δ ɾฒྻԽ͠ͳ͍
ͬͨ͜ͱ Play + akka scheduler ManagerActor ɾҾΛݩʹ࣮ߦ͍ͨ͠childActorΛࢦఆ͢Δ ɾchildActor͕ఀࢭ͍ͯΔ͔Ͳ͏͔ͷ ɹεςʔλεΛ͍࣋ͬͯΔ
ɹ(isAliveChildActorͷ෦) ɾManagerActorͷఀࢭΛड͚ͨΒɺ ɹ࣮ߦ͍ͯ͠ΔchildActorΛstop͢Δ ɹTerminatedͨ͠߹ɺεςʔλεΛ ɹfalseʹ͢Δ
ͬͨ͜ͱ Play + akka scheduler Playىಈ࣌ͷManagerActorͷॲཧ
ͬͨ͜ͱ Play + akka scheduler PlayΛఀࢭ͢Δࡍͷॲཧ ɾManagerActorͷఀࢭΛ֬ೝ ͢Δ·Ͱແݶϧʔϓ
ͬͨ͜ͱ Play + akka scheduler ▸ ىಈ࣌ͷίϚϯυ test1ͷॲཧΛ࣮ߦ͍ͨ͠߹ɿ activator run
-Ddaemon-process=test1 test2ͷॲཧΛ࣮ߦ͍ͨ͠߹ɿ activator run -Ddaemon-process=test2
݁Ռ Play + akka scheduler ▸ σʔϞϯԽָ͕ (σʔϞϯͰ໘ͳ෦ΛPlay͕ͬͯ͘ΕΔʣ ▸ Ҿ͝ͱʹ࣮ߦ͍ͨ͠ActorΛબͰ͖Δ
▸ JVMͷOld Memory͕ཷ·Γଓ͚͍ͯΔͷͰɺ ̍Ұճ࠶ىಈ͍ͯ͠·͢ɻ ʢ͍͔͍ͭͨ͠ʣ
Play + akka schedulerΛ͑ɻɻ( D: σΟϨΫλʔɺE:ΤϯδχΞ) ▸ Dʮ͜ͷػೳɺཧը໘͕มߋ͞ΕͨΒߋ৽ͯ͠΄͍͠ʯ ▸ Eʮ͜ͷػೳͷߋ৽සɺͲΕ͘Β͍ʹ͠·͢ʁʯ
▸ DʮͳΔͰʯ ▸ E ʮ͡Όɺ50msͰ͍͍Ͱ͔͢ʁʯ ▸ Dʮ͑ʂʁ͗͢͡ΌͶʁʯ
Έͳ͞ΜɺͲ͏ͬͯ·͔͢ʁ ڭ͍͑ͯͩ͘͞ɻ
ऴΘΓ αϯϓϧίʔυ https://github.com/oomatomo/scala-akka-daemon