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
97
事業貢献を考えるための技術改善の目標設計と改善実績 / Targeted design of technical improvements to consider business contribution and improvement performance
oomatomo
0
1.3k
プロダクト開発の貢献をアピールするための目標設計や認知活動 / 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
130
事業貢献を見据えた モダナイゼーションへの挑戦
oomatomo
1
100
UXへの投資と組織変革 ─ ビジネスに貢献するUXチームの飛躍 ─
oomatomo
1
57
Finagleを使った広告配信基盤
oomatomo
0
490
Finagleを使った Perl -> Scalaへの移行
oomatomo
0
1.9k
Other Decks in Programming
See All in Programming
「”誤った使い方をすることが困難”な設計」で良いコードの基礎を固めよう / phpcon-odawara-2025
taniguhey
0
120
DataStoreをテストする
mkeeda
0
280
Vibe Codingをせずに Clineを使っている
watany
17
6.1k
MCP調べてみました! / Exploring MCP
uhzz
2
2.2k
Making TCPSocket.new "Happy"!
coe401_
1
130
Empowering Developers with HTML-Aware ERB Tooling @ RubyKaigi 2025, Matsuyama, Ehime
marcoroth
1
240
Coding Experience Cpp vs Csharp - meetup app osaka@9
harukasao
0
730
Boost Your Performance and Developer Productivity with Jakarta EE 11
ivargrimstad
0
1.2k
Building a macOS screen saver with Kotlin (Android Makers 2025)
zsmb
1
140
AIコーディングワークフローの試行 〜AIエージェント×ワークフローでの自動化を目指して〜
rkaga
2
3.4k
[NG India] Event-Based State Management with NgRx SignalStore
markostanimirovic
1
110
Qiita Bash
mercury_dev0517
1
190
Featured
See All Featured
Evolution of real-time – Irina Nazarova, EuRuKo, 2024
irinanazarova
8
650
Practical Orchestrator
shlominoach
186
10k
Into the Great Unknown - MozCon
thekraken
37
1.7k
Code Reviewing Like a Champion
maltzj
522
39k
Responsive Adventures: Dirty Tricks From The Dark Corners of Front-End
smashingmag
251
21k
Helping Users Find Their Own Way: Creating Modern Search Experiences
danielanewman
29
2.5k
10 Git Anti Patterns You Should be Aware of
lemiorhan
PRO
656
60k
Embracing the Ebb and Flow
colly
85
4.6k
Why Our Code Smells
bkeepers
PRO
336
57k
Principles of Awesome APIs and How to Build Them.
keavy
126
17k
It's Worth the Effort
3n
184
28k
Making Projects Easy
brettharned
116
6.1k
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