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
shiro seike
PRO
June 10, 2021
Programming
200
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
Why Continue AWS Community Builders
seike460
PRO
0
68
AWSコミュニティ活動は顧客のクラウド推進に効くのか / Do AWS community activities help customers adopt the cloud?
seike460
PRO
0
180
テレメトリーシグナルが導くパフォーマンス最適化 / Performance Optimization Driven by Telemetry Signals
seike460
PRO
2
270
AI-DLC 入門 〜AIコーディングの本質は「コード」ではなく「構造」〜 / Introduction to AI-DLC: The Essence of AI Coding Is Not “Code” but “Structure”
seike460
PRO
0
1.2k
今さら聞けないサーバーレスのいいところ 〜運用から解放される世界を目指して〜 / The Benefits of Serverless You Might Be Too Embarrassed to Ask About Now — Aiming for a World Free from Operational Burdens
seike460
PRO
0
100
AWS Lambda Durable Functions のユースケースを探る / Exploring Use Cases for AWS Lambda Durable Functions
seike460
PRO
0
89
歴史から学ぶ「Why PHP?」 PHPを書く理由を改めて理解する / Learning from History: “Why PHP?” Rediscovering the Reasons for Writing PHP
seike460
PRO
0
510
Team-First Serverless Platform Engineering Approach to PHP Applications with Laravel and Bref
seike460
PRO
1
160
地方だからできる!コミュニティ参加と登壇を続ける意義 / “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
27
Other Decks in Programming
See All in Programming
Signal Forms: Beyond the Basics @ngBaguette 2026 in Paris
manfredsteyer
PRO
0
220
AutonomyとControlのあいだ:Graflowで記述するAIエージェント協調
myui
0
100
Spec-Driven Development with AI-Agents: From High-Level Requirements to Working Software
antonarhipov
2
440
密結合なバックエンドから TypeScript のコードを生成する
kemuridama
1
710
ビジネスモデルから紐解く、AI+型駆動開発
hirokiomote
2
5.2k
TypeScriptだけでAIエージェントを作る フロント・エージェント・インフラのフルスタック実践
har1101
6
1.3k
AIとASP.NET Coreで雑Webアプリを作った話
mayuki
0
280
Old Dog, New Tricks: The Java 25 Reinvention - JNation
bazlur_rahman
0
140
LLM Plugin for Node-REDの利用方法と開発について
404background
0
160
決定論的オーケストレーションの設計と実装 / Design and Implementation of Deterministic Orchestration
nrslib
3
980
Technical Debt: Understanding it Rightly, Engaging it Rightly #LaravelLiveJP
shogogg
0
190
CLIであることを活かしたGitHub Copilot CLI活用術 / GitHub Copilot CLI Pro Tips & Tricks
nao_mk2
1
1.2k
Featured
See All Featured
Ruling the World: When Life Gets Gamed
codingconduct
0
240
Automating Front-end Workflow
addyosmani
1370
210k
Visualization
eitanlees
152
17k
"I'm Feeling Lucky" - Building Great Search Experiences for Today's Users (#IAC19)
danielanewman
231
23k
Thoughts on Productivity
jonyablonski
76
5.2k
Jamie Indigo - Trashchat’s Guide to Black Boxes: Technical SEO Tactics for LLMs
techseoconnect
PRO
0
160
How to Build an AI Search Optimization Roadmap - Criteria and Steps to Take #SEOIRL
aleyda
1
2.1k
The AI Revolution Will Not Be Monopolized: How open-source beats economies of scale, even for LLMs
inesmontani
PRO
3
3.5k
It's Worth the Effort
3n
188
29k
Pawsitive SEO: Lessons from My Dog (and Many Mistakes) on Thriving as a Consultant in the Age of AI
davidcarrasco
0
160
sira's awesome portfolio website redesign presentation
elsirapls
0
270
ReactJS: Keep Simple. Everything can be a component!
pedronauck
666
130k
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/