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
Goでパイプライン/Pipeline_with_Go
Search
Sponsored
·
SiteGround - Reliable hosting with speed, security, and support you can count on.
→
shiro seike
PRO
June 10, 2021
Programming
220
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
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
Seeing Through Serverless: Observability for AWS Lambda with ADOT and CloudWatch Application Signals
seike460
PRO
1
140
Seeing Through Serverless: ADOT と CloudWatch Application Signals で実現する AWS Lambda のオブザーバビリティ(日本語版)/ Seeing Through Serverless (Japanese Edition)
seike460
PRO
1
23
モノレポの型は、そのままつながる 〜Hono RPCで型を素通しする開発体験〜 / Monorepo Types Connect As-Is: Passing Types Through with Hono RPC
seike460
PRO
1
30
OSSのコンセプトを知る / Understanding the Concept Behind an OSS
seike460
PRO
1
29
型も通る、synthも通る、それでも危ない 〜AIのCDKの権限とコストを機械で検証する〜 / It Passes Type Checks, It Passes Synth Checks, but It’s Still Risky — Automatically Verifying Permissions and Costs in AI’s CDK —
seike460
PRO
1
640
コミュニティの有益性 ~JAWS Days 2026 での体験を通して~ / The Benefits of a Community ~Through My Experience at JAWS Days 2026~
seike460
PRO
0
460
実行委員長目線で振り返る JAWS DAYS 2026 / JAWS DAYS 2026 from the Chair's Perspective
seike460
PRO
1
27
SLO から始める SRE / Starting SRE with SLO
seike460
PRO
1
100
Architecture as SteeringOn-Ramp to AI-DLC
seike460
PRO
0
65
Other Decks in Programming
See All in Programming
アクセシビリティから考える情報設計
high_g_engineer
0
380
AI に Inclusive UI を書かせよう — Design Rules Skill で Compose UI を作り直す
theoriatec2024
1
490
世界の中心で、AI(App Intents)をさけぶ ー App Intents中心設計の実践ガイド
touyou
0
570
MVNOの申込からeSIM開通までをiOSアプリでつなぐ- 本人確認・MNP・通信事業者基盤をまたぐ実装
satotakeshi
0
410
WebRTC映像をAirPlayに対応させる挑戦.pdf
monolithic_adam
0
260
巨大モノリシックアプリ モダン化大作戦
ktcryomm
0
1k
更なる可用性を求めて、5年間運用したKotlinのアプリケーションをGoでリプレイスする話
ken_tunc
0
240
LoopHub - ローカルで動く GitHub で、AI と共同開発
jugyo
1
550
AI Agent時代のリアーキテクチャ戦略と実践
hokaccha
9
4.5k
AIを上手に使っていこうとしたら越境せざるを得なくなった話 〜実践1年で見えた境界を越えなければならない理由と進め方〜 / Crossing borders with AI
tomoyakitaura
4
1.2k
Vibes Containers 〜AIで変わるコンテナ設計と運用〜
tkikuc
3
550
App Intentsのビルドプロセスを支える技術
kntkymt
0
370
Featured
See All Featured
Making the Leap to Tech Lead
cromwellryan
135
10k
Context Engineering - Making Every Token Count
addyosmani
9
1.1k
Claude Code どこまでも/ Claude Code Everywhere
nwiizo
67
58k
Leveraging Curiosity to Care for An Aging Population
cassininazir
1
490
Getting science done with accelerated Python computing platforms
jacobtomlinson
2
480
Why Your Marketing Sucks and What You Can Do About It - Sophie Logan
marketingsoph
0
410
Beyond borders and beyond the search box: How to win the global "messy middle" with AI-driven SEO
davidcarrasco
3
240
Become a Pro
speakerdeck
PRO
31
6.3k
What's in a price? How to price your products and services
michaelherold
247
13k
Game over? The fight for quality and originality in the time of robots
wayneb77
1
280
Java REST API Framework Comparison - PWX 2021
mraible
34
9.7k
AI Search: Implications for SEO and How to Move Forward - #ShenzhenSEOConference
aleyda
1
1.4k
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/