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
80
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
AIを活用した化学反応的なスピード開発 TDD × ペアプロ × AI / Chemically Reactive Speed Development with AI. TDD-Pair Pro-AI
oomatomo
0
330
事業貢献を考えるための技術改善の目標設計と改善実績 / Targeted design of technical improvements to consider business contribution and improvement performance
oomatomo
0
1.4k
プロダクト開発の貢献をアピールするための目標設計や認知活動 / Goal design and recognition activities to promote product development contributions.
oomatomo
5
1.5k
多様性のあるプロダクトチームを目指した共創の3年間の変化 / Three Years of Co-Creation for Diverse Product Teams Change
oomatomo
1
150
事業貢献を見据えた モダナイゼーションへの挑戦
oomatomo
1
110
UXへの投資と組織変革 ─ ビジネスに貢献するUXチームの飛躍 ─
oomatomo
1
58
Finagleを使った広告配信基盤
oomatomo
0
490
Finagleを使った Perl -> Scalaへの移行
oomatomo
0
1.9k
Other Decks in Programming
See All in Programming
The Missing Link in Angular’s Signal Story: Resource API and httpResource
manfredsteyer
PRO
0
140
2025-04-25 GitHub Copilot Agent ライブデモ(スクリプト)
goataka
0
100
AIコーディングエージェントを 「使いこなす」ための実践知と現在地 in ログラス / How to Use AI Coding Agent in Loglass
rkaga
4
1.2k
Instrumentsを使用した アプリのパフォーマンス向上方法
hinakko
0
230
Empowering Developers with HTML-Aware ERB Tooling @ RubyKaigi 2025, Matsuyama, Ehime
marcoroth
2
950
M5UnitUnified 最新動向 2025/05
gob
0
120
Creating Awesome Change in SmartNews! En
martin_lover
0
110
ウォンテッドリーの「ココロオドル」モバイル開発 / Wantedly's "kokoro odoru" mobile development
kubode
1
260
エンジニアが挑む、限界までの越境
nealle
1
310
状態と共に暮らす:ステートフルへの挑戦
ypresto
3
1.1k
ニーリーQAのこれまでとこれから
nealle
2
160
Boost Your Performance and Developer Productivity with Jakarta EE 11
ivargrimstad
0
760
Featured
See All Featured
Faster Mobile Websites
deanohume
306
31k
The Pragmatic Product Professional
lauravandoore
33
6.6k
Imperfection Machines: The Place of Print at Facebook
scottboms
267
13k
Building Adaptive Systems
keathley
41
2.5k
Sharpening the Axe: The Primacy of Toolmaking
bcantrill
41
2.3k
Improving Core Web Vitals using Speculation Rules API
sergeychernyshev
13
820
The Art of Programming - Codeland 2020
erikaheidi
54
13k
Dealing with People You Can't Stand - Big Design 2015
cassininazir
367
26k
Creating an realtime collaboration tool: Agile Flush - .NET Oxford
marcduiker
30
2k
A Tale of Four Properties
chriscoyier
159
23k
Why Our Code Smells
bkeepers
PRO
336
57k
Docker and Python
trallard
44
3.4k
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