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
PHP ステートレス VS ステートフル 状態管理と並行性 / php-stateless-s...
Search
yuuki takezawa
February 05, 2025
Programming
380
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
PHP ステートレス VS ステートフル 状態管理と並行性 / php-stateless-stateful
つよナレ #1 PHPにまつわる話
https://techtrain.connpass.com/event/330882/
でのお話です
yuuki takezawa
February 05, 2025
More Decks by yuuki takezawa
See All by yuuki takezawa
なぜAI時代に 「イベント」を中心に考えるのか? / Why focus on "events" in the age of AI?
ytake
4
2.2k
PHPでアクターモデルを活用したSagaパターンの実践法 / php-saga-pattern-with-actor-model
ytake
0
3.1k
PHPでアクターモデルを理解・体験しよう / Understand and experience the actor model in PHP
ytake
2
1k
再考 アクターモデル/ reconsider actor model
ytake
0
1.7k
GoとアクターモデルでES+CQRSを実践! / proto_actor_es_cqrs
ytake
1
740
Phluxorでアクターモデルを 理解・体験しよう / toolkit-for-flexible-actor-models-in-php-phluxor
ytake
1
400
オブジェクトのおしゃべり大失敗 メッセージングアンチパターン集 / messaging anti-pattern collection
ytake
2
1.4k
DRE/SREのプラクティス融合によるクラウドネイティブなデータ基盤作り / dre_sre
ytake
0
1.1k
技術的負債と向き合う取り組みでよかったもの / positive_efforts_to_tackle_technical_debt
ytake
10
4.1k
Other Decks in Programming
See All in Programming
AI主導のプログラミング学習アプリを作ってみた
econanringo
0
110
設計次第でAIコードの読む量は減らせる / designing-for-code-reading
minodriven
34
16k
Jetpack Compose Mechanisms
skydoves
2
570
ハーネス設計入門 〜 基礎知識の整理から実務へのステップアップ 〜
kinopeee
21
21k
ソニーのクラウド共通基盤の変遷とAI時代の開発スタイルに合わせた進化 / The Journey of Sony’s Common Cloud Platform and Its Evolution for AI-Native Development
kenjiyoneyama
0
240
速習iPhone Duo対応
yuukiw00w
2
970
GitHubハンズオン講座 — 実務レベルのチーム開発のフローを身につけよう
junhat6
0
120
UnityでSystem.Net.WebSocketsなWebSocketサーバが動かないのでUnity Monoのコードを覗いてみた / about implementing websocket server with unity mono
drumath2237
1
560
カツオ、ご期待ください
suneo3476
0
160
Vue Fes Japan の “作る側”に関わってみて
naokihaba
0
130
GemmaをJevのように使ってみる / Use Gemma like Jev
kishida
5
730
JRuby: Past, Present, and Future
headius
0
220
Featured
See All Featured
The browser strikes back
jonoalderson
0
1.8k
JavaScript: Past, Present, and Future - NDC Porto 2020
reverentgeek
52
6.1k
The B2B funnel & how to create a winning content strategy
katarinadahlin
PRO
1
550
Music & Morning Musume
bryan
48
7.4k
Practical Tips for Bootstrapping Information Extraction Pipelines
honnibal
25
2.1k
職位にかかわらず全員がリーダーシップを発揮するチーム作り / Building a team where everyone can demonstrate leadership regardless of position
madoxten
69
66k
How People are Using Generative and Agentic AI to Supercharge Their Products, Projects, Services and Value Streams Today
helenjbeal
2
350
GitHub's CSS Performance
jonrohan
1033
470k
Designing for Performance
lara
612
70k
A brief & incomplete history of UX Design for the World Wide Web: 1989–2019
jct
2
530
Data-driven link building: lessons from a $708K investment (BrightonSEO talk)
szymonslowik
1
1.4k
Primal Persuasion: How to Engage the Brain for Learning That Lasts
tmiket
0
490
Transcript
εςʔτϨε VS εςʔτϑϧ ঢ়ଶཧͱฒߦੑ TechTrain ͭΑφϨ #1 PHPʹ·ͭΘΔ ytake
Pro fi le • ᖒ ༗و a.k.a ytake • ઍגࣜձࣾ
CTO / ΄͔ٕज़ސ • Go / Scala / Kotlin • ΞΫλʔϞσϧɺσʔλج൫ɺDDD·ΘΓɺࢄॲཧͳͲ
ঢ়ଶͱϥϯλΠϜ • ϥϯλΠϜͷҧ͍Λཧղ͓͖ͯ͠·͠ΐ͏ • εςʔτϨε͔εςʔτϑϧ ͲͪΒ͔Ͱͳ྆͘ํ͏·͘ѻ͏ • PHPͰฒߦॲཧΛ͏·͘Δʹঢ়ଶཧ͕ඞཁʂ
PHP • WebΞϓϦέʔγϣϯͱͯ͠ੈքͰͨ͘͞ΜΘΕ͍ͯΔݴޠ • FacebookݩʑPHP / PHPͷݱࡏͷਐԽʹେ͖͘ߩݙ • ͳΜ͔ͩΜͩWordpressҒେ •
WebαʔόͷϞδϡʔϧɺ͘͠࿈ܞͯ͠ಈ͘ࣄ͕ଟ͍
Go • goroutineͱ͍͏ΈΛͬͯฒߦॲཧΛಘҙͱ͢Δݴޠ • γϯάϧόΠφϦͰϓϩηεͱͯ͠ಈ࡞ • ίϯςφͱͷ૬ੑྑ͍ • ΞϓϦέʔγϣϯαʔόͱͯ͠ػೳʢWebαʔόෆཁʣ
Scala • ScalaؔܕϓϩάϥϛϯάͱΦϒδΣΫτࢦ • ޮతͳฒߦॲཧΛαϙʔτ͢ΔFutureͳͲ • σʔλॲཧܥେنͳΈΛࢧ͑Δ͜ͱ͕ଟ͍ • ΞϓϦέʔγϣϯαʔόͱͯ͠ػೳʢWebαʔόෆཁʣ
ͦͦฒߦͬͯʁ • ฒྻ"શʹಠཱ"ͯ͠ϦιʔεΛফඅ͢Δͷ • ฒߦϦιʔεΛڞ༗͠ͳ͕Βަޓʹফඅ ॲཧத"ฒྻʹݟ͑Δࣄ͕͋Δ" • PHPͰ؆୯ʹѻ͑ΔͷͦΜͳʹଟ͘ͳ͍
ͦͦฒߦͬͯʁ • खΛୟ͘ͷ͕ऴΘ͔ͬͯΒΛୟ͘ͷ͕ஞ࣍ • खΛୟ͍͍͚ͯͨͲ్தͰΊͯΛୟ͍ͯ ·ͨखΛୟ͘Έ͍ͨͳͷ͕ฒߦ • खͱΛಉ࣌ୟ͘ͷ͕ฒྻ • खΛୟ͖͍ͨͳ͊ͱࢥ͍͔ͬͯͭୟ͘ͷ͕ඇಉظ
• खΛୟͧ͘ʂͰୟ͘ͷ͕ಉظ
େ͖ͳҧ͍ͬͯʁ • PHP HTTPϦΫΤετ͕དྷͨΒͦͷϓϩηεΛ্ཱͪ͛ͯऴྃ • جຊతʹঢ়ଶΛ࣋ͨͣʢ࣋ͯͳ͍ʣɺ ঢ়ଶอ࣋֎෦ʹ͓ئ͍͢ΔΈ • ނʹඇৗʹγϯϓϧ
େ͖ͳҧ͍ͬͯʁ • GoScalaϓϩηεͱͯ͠ಈ࡞͢ΔͨΊɺ ঢ়ଶΛཧ͠ͳ͕ΒޮతʹॲཧΛߦ͏ • ͕ࣗσʔλετϨʔδʹͳΔ͜ͱͪΖΜOK • ϓϩηεͱͯ͠ঢ়ଶΛࣗͰ࣋ͭͨΊɺ ฒߦॲཧͳͲ༰қ
PHPͰฒߦॲཧ͍ͨ͠ɾɾʁ • ผϓϩηεͰىಈͨ͠PHPϓϩηεಉ࢜ͷ ίϛϡχέʔγϣϯ͕͍͠ɾɾ • εϨουతͳͷͳ͍ʢextentionআ͘ʣ • ॏ͍ͨॲཧඇಉظʹ͢Δ͔͠ͳ͍ɾɾ
None
PHPͰඇಉظॲཧ͍ͨ͠ɾɾʁ • QueueͳͲͷϛυϧΣΞΛͬͯ ผϓϩηεɾΞϓϦέʔγϣϯͱͯ͠औΓʹߦͬͯॲཧ • SwooleReactPHPͳͲΛซ༻ͯ͠ؤுΔ • ϓϩηεͱͯ͠ಈ࡞ͤ͞ΔͨΊʹsupervisorͳͲͰཧ͠ͳ͚Εɾ
ॱ൪ • Ͳ͕ͬͪૣ͘ऴΘΔ͔ • ࢄͨ͠ͱ͖ૢ࡞ෆՄ
PHPͰৗ࣌ϓϩηεʹ͢ΔͱϋϚΔͷ • εςʔτϨεલఏͷίʔυΛॻ͘ͱϝϞϦϦʔΫʹɾɾ • ඞཁ͕ͳ͘ͳͬͨมͱʹ͔͘ϝϞϦ͔Βଈղ์͢Δʂ • σʔλϕʔεconnectͱdisconnectΛ͖ͪΜͱཧ͢Δ • ࣋ଓଓ͕ۤखͳͷͰɺphp.iniWebαʔόͷઃఆΛ
GoScalaͰɾɾʁ • ͦͦϙΠϯλεϨουͳͲͰޮతʹॲཧ͢ΔΈ • ΞυϨεʹଓͳͲΛ֬อ͍ͯ͠ճͨ͠Γ͢Δ • ScalaͰΞΫλʔΛར༻ͯ͠ҙਤతʹϦιʔεؔ࿈ૢ࡞Ͱ͖Δ
<?php use Swoole\Http\Server; $server = new Server("127.0.0.1", 9501); $leakyArray =
[]; $server->on("request", function ($request, $response) use (&$leakyArray) { $leakyArray[] = str_repeat("leak", 1000); $tempFile = fopen("/tmp/tempfile", "w"); fwrite($tempFile, "temporary data"); $response->end("Hello World\n"); }); $server->start();
<?php use Swoole\Http\Server; $server = new Server("127.0.0.1", 9501); $leakyArray =
[]; $server->on("request", function ($request, $response) use (&$leakyArray) { $leakyArray[] = str_repeat("leak", 1000); $tempFile = fopen("/tmp/tempfile", "w"); fwrite($tempFile, "temporary data"); $response->end("Hello World\n"); }); $server->start(); ϦΫΤετͷͨͼʹ Ճ
<?php use Swoole\Http\Server; $server = new Server("127.0.0.1", 9501); $leakyArray =
[]; $server->on("request", function ($request, $response) use (&$leakyArray) { $leakyArray[] = str_repeat("leak", 1000); $tempFile = fopen("/tmp/tempfile", "w"); fwrite($tempFile, "temporary data"); $response->end("Hello World\n"); }); $server->start(); Ϧιʔε։์Ε '%͕Ұഋʹɾɾ
None
PHPͰΞΫλʔϞσϧΛཧղɾମݧ͠Α͏ Understand and experience the actor model in PHP phpcon
okinawa 2024 yuuki takezawa a.k.a ytake
γϯάϧτϯ • PHPͷγϯάϧτϯHTTPͷϥΠϑαΠΫϧͷΈͷͷ • PHPͰৗ࣌ϓϩηεͰγϯάϧτϯʹ͢Δͱ ଞͷॴͰॻ͖ࠐ·ΕΔ͜ͱ͋Γɺঢ়ଶมΘΔ • mutexͳͲซ༻͠Α͏ʂ • DIίϯςφ͕ରԠ͍ͯ͠ͳ͍߹ଟ͋Γ
͓·͚ PHP͋Δ͋Δ1 • ޮՌతʹΩϟογϡ͢ΔͨΊʹphpserialize͠Α͏ʂ • ଞݴޠ͔Βར༻Ͱ͖ͳ͍ɾɾ ͔ͭ෮ݩ͠Α͏ͱ͢ΔPHPΞϓϦέʔγϣϯ ಉ͡ΫϥεͳͲΛߏͱ͍ͯ࣋ͬͯ͠ͳ͚ΕͳΒͳ͍ • ଞݴޠͱΓऔΓΛߦ͏߹ϚΠΫϩαʔϏεͰආ͚Α͏ʂ
·ͱΊ • ϥΠϑαΠΫϧϥϯλΠϜͷҧ͍Λཧղ͠·͠ΐ͏ʂ • ݴޠ͕ѱ͍ͷͰͳͯ͘େମ࡞Γํͷ • ͍ΖΜͳݴޠΛ৮ͬͯࣝΛ͚ͭΑ͏ʂ