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
Server Push Middleware "Plasma"
Search
stormcat24
April 29, 2017
Programming
2
5.2k
Server Push Middleware "Plasma"
stormcat24
April 29, 2017
Tweet
Share
More Decks by stormcat24
See All by stormcat24
素早く賢く失敗するDeveloper Productivityの実現を目指して
stormcat24
2
2.8k
KubernetesのマニフェストをそれなりにCIしたい
stormcat24
4
1.2k
令和時代のSaaS開発
stormcat24
1
230
History in 5 years of CircleCI and CyberAgent
stormcat24
3
790
Kubernetes Handson Osaka
stormcat24
5
530
Kubernetes Handson
stormcat24
5
4.1k
DockerとKubernetesでアプリケーション開発にコンテナをフル活用!
stormcat24
0
280
Base Image Journey 2018
stormcat24
29
130k
kotlin-fest
stormcat24
13
17k
Other Decks in Programming
See All in Programming
The rollercoaster of releasing an Android, iOS, and macOS app with Kotlin Multiplatform | droidcon Berlin
prof18
0
110
Product Management LT会_クアンド新家
shinshin
0
270
ぼっちを避けて楽しむためのアノテコノテ / Various Tips and Tricks to Avoid Loneliness and Have Fun
nrslib
3
1.7k
しくじり先生 Image Matching Challenge 2024 編
goosehaaan
0
810
Introduction to GitOps
hwchiu
0
110
OpenAI/Gemini APIを使って EPUBを翻訳するCLIツールをつくってみた
tomiyan
0
800
スクラムマスターって孤独じゃないですか?
yoshitaroyoyo
1
140
CSC307 Lecture 12
javiergs
PRO
0
220
生成AIをkintoneに連携してみた
hideg
0
230
CSC307 Lecture 05
javiergs
PRO
0
210
Webエディタライブラリ 「CodeMirror」から学ぶ Webアプリ開発のテクニック
ryosukeigarashi
0
250
継続的な活動で築く地方エンジニアの道
myamashii
2
360
Featured
See All Featured
Designing for Performance
lara
604
67k
In The Pink: A Labor of Love
frogandcode
139
22k
Dealing with People You Can't Stand - Big Design 2015
cassininazir
360
22k
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
36
9.1k
Web Components: a chance to create the future
zenorocha
307
41k
From Idea to $5000 a Month in 5 Months
shpigford
377
46k
Stop Working from a Prison Cell
hatefulcrawdad
266
20k
GraphQLの誤解/rethinking-graphql
sonatard
59
9.6k
Adopting Sorbet at Scale
ufuk
71
8.8k
The Mythical Team-Month
searls
217
43k
Practical Orchestrator
shlominoach
185
10k
Building a Modern Day E-commerce SEO Strategy
aleyda
25
6.7k
Transcript
Server Push Middleware “Plasma” @stormcat24 2017.04.29 そうだ Go、京都。
‣ CyberAgent, Inc. ‣ FRESH! https://freshlive.tv ‣ FRESH!はmackerelを利用しています(これ大事) ‣ http://blog.stormcat.io
‣ ワタシGoチョットデキル ‣ 最近の興味はRustとKotlin stormcat24
天皇賞のついでに喋りに来ました
突然ですがポーリングしてますか
ポーリングのシーン・・・ ‣ アプリケーションの状態変化の検知 ‣ 通知を疑似的にServer Pushぽく見せたり ‣ Job Queueのロングポーリング
あまりにも多くの HTTPリクエストが討ち死にしてきた ほぼ同じレスポンスだというのに・・・ ※応仁の乱
世の中のポーリングを撲滅したい
https://github.com/openfresh/plasma
Plasma is ‣ Go製の汎用的なServer Push型ミドルウェア ‣ gRPC StreamとServer-Sent Event(SSE)に対応 ‣
Web/iOS/Android/Serverから状態変化検知を撲滅したくて構想 ‣ 実装はインターン生(@upamune)がほぼ一人でやった
クライアントは必要なイベントタイプを指定し、 subscribeするだけでデータが降ってくる
Plasmaへの接続 ‣ gRPC Streamの場合 ‣ proto定義がPlasmaのリポジトリにあるので、protogenでstubを作る ‣ SSEの場合 ‣ polyfillあります
https://github.com/Yaffle/EventSource ‣ サーバから一定期間データが来ないと接続が切れるブラウザがあるの で、Plasmaは切れないようにHeartbeatする
ユースケース ‣ 状態変化の監視のためポーリングをサーバプッシュに置き換える ‣ Microservices間で別のサービスで起きたイベントを受け取る ‣ Microservicesを跨いだキャッシュの伝搬(試験運用中!)
Server Pushはいいぞ
さあ、ポーリングの屍を乗り越えて行こう ※現在進捗10%
Thanks!