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
Goでパイプライン/Pipeline_with_Go
Search
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
shiro seike
PRO
June 10, 2021
Programming
190
0
Share
Goでパイプライン/Pipeline_with_Go
Fukuoka.go#17
https://fukuokago.connpass.com/event/202570/
shiro seike
PRO
June 10, 2021
More Decks by shiro seike
See All by shiro seike
AWSコミュニティ活動は顧客のクラウド推進に効くのか / Do AWS community activities help customers adopt the cloud?
seike460
PRO
0
140
テレメトリーシグナルが導くパフォーマンス最適化 / Performance Optimization Driven by Telemetry Signals
seike460
PRO
2
230
AI-DLC 入門 〜AIコーディングの本質は「コード」ではなく「構造」〜 / Introduction to AI-DLC: The Essence of AI Coding Is Not “Code” but “Structure”
seike460
PRO
0
610
今さら聞けないサーバーレスのいいところ 〜運用から解放される世界を目指して〜 / The Benefits of Serverless You Might Be Too Embarrassed to Ask About Now — Aiming for a World Free from Operational Burdens
seike460
PRO
0
84
AWS Lambda Durable Functions のユースケースを探る / Exploring Use Cases for AWS Lambda Durable Functions
seike460
PRO
0
70
歴史から学ぶ「Why PHP?」 PHPを書く理由を改めて理解する / Learning from History: “Why PHP?” Rediscovering the Reasons for Writing PHP
seike460
PRO
0
440
Team-First Serverless Platform Engineering Approach to PHP Applications with Laravel and Bref
seike460
PRO
1
140
地方だからできる!コミュニティ参加と登壇を続ける意義 / “It’s Possible Because We’re in a Regional Area!” The Significance of Continuing to Participate in and Speak at Community Events
seike460
PRO
0
2
地方で実現!九州、福岡近郊のAWS活用事例 / Success Stories from the Regions! AWS Use Cases in Kyushu and the Fukuoka Area
seike460
PRO
0
15
Other Decks in Programming
See All in Programming
TiDBのアーキテクチャから学ぶ分散システム入門 〜MySQL互換のNewSQLは何を解決するのか〜 / tidb-architecture-study
dznbk
1
180
ハンズオンで学ぶクラウドネイティブ
tatsukiminami
0
130
AI時代のエンジニアリングの原則 / Engineering Principles in the AI Era
haru860
0
340
ソフトウェア設計の結合バランス #phperkaigi
kajitack
0
130
事業会社でのセキュリティ長期インターンについて
masachikaura
0
250
t *testing.T は どこからやってくるの?
otakakot
1
660
forteeの改修から振り返るPHPerKaigi 2026
muno92
PRO
3
290
tRPCの概要と少しだけパフォーマンス
misoton665
2
210
The Less-Told Story of Socket Timeouts
coe401_
3
300
おれのAgentic Coding 2026/03
tsukasagr
1
150
AI-DLC Deep Dive
yuukiyo
9
4.2k
Offline should be the norm: building local-first apps with CRDTs & Kotlin Multiplatform
renaudmathieu
0
220
Featured
See All Featured
Building Adaptive Systems
keathley
44
3k
The Power of CSS Pseudo Elements
geoffreycrofte
82
6.2k
[SF Ruby Conf 2025] Rails X
palkan
2
960
The Pragmatic Product Professional
lauravandoore
37
7.2k
A Soul's Torment
seathinner
6
2.7k
Imperfection Machines: The Place of Print at Facebook
scottboms
270
14k
jQuery: Nuts, Bolts and Bling
dougneiner
66
8.4k
How to audit for AI Accessibility on your Front & Back End
davetheseo
0
250
How STYLIGHT went responsive
nonsquared
100
6.1k
Build The Right Thing And Hit Your Dates
maggiecrowley
39
3.1k
How to make the Groovebox
asonas
2
2.1k
svc-hook: hooking system calls on ARM64 by binary rewriting
retrage
2
210
Transcript
Goでパイプライン Fukuoka.go #17 2021.06.10 清家 史郎 1
自己紹介 清家 史郎 seike460 - ID - Github:seike460 - Twitter:@seike460
- Work at - 株式会社 Fusic (フュージック) 技術開発本部/技術開発第一部門 ▪ エバンジェリスト ▪ チームリーダー ▪ プリンシパルエンジニア - Skill - PHP - Go - AWS 2
パイプライン
パイプライン パイプライン データストリームやバッチ処理を行う際等に、 データを受け取って何らかの処理を行って、どこかに渡す一連の作業 これらの操作をパイプラインのステージと呼びます。 ステージには以下の性質があります。
- 前段ステージの戻り値の型と 後段ステージの入力の型が一致している - 引き回せる様に具体化されている (Goは関数の形で具体化されている) 4
kat-co/concurrency-in-go-src Goでパイプラインを作るぞ!
パイプライン処理の例 6 fig-functional-pipeline-combination.go int sliceと intを引数に int sliceを戻り値に取る関数
ステージの追加例 7 fig-adding-additional-stage-to-pipeline.go int sliceと intを引数に int sliceを戻り値に取る関数
パイプラインの利点 ステージ自体を変更する事なく、簡単にステージを組み合わせる事が出来る パイプラインの利点を理解したところで、Goならではのパイプラインを考えます。 チャネルを利用して、パイプラインを構築することで、 並列処理をパイプラインにて処理する事が出来るようになります。
8
チャネルを利用したパイプライン処理 9 fig-pipelines-chan-stream-processing.go generatorで可変長引数のint slice 整数バッファ付きチャネルを作成し
作成したチャネルを返す
数字ストリームを受けた multiply 10 数字ストリームを受け、 2倍したチャネルを返す
数字ストリームを受けた add 11 数字のストリームを受け、 引数の整数を足したチャネルを返す
パイプラインを利用した例 (ストリーム型) 12 fig-pipelines-func-stream-processing.go 各ステージでは前段の戻り値と 後段の入力値が一致しており、 安全に並列処理が行える
パイプラインが構築出来る
まとめ Point 3 「Go言語による並行処理」はいい本なのでぜひ読みましょう 13 ステージを介する事で簡単にパイプラインを構築する事が出来る Point 1
Goのチャネルをつかうと、パイプラインパターンを利用しながら並列処理が可能になる Point 2
ご清聴いただきありがとうございました Thank You We are Hiring ! https://recruit.fusic.co.jp/