Submit Search
Upload
Elixirでslackのbotを作った話
•
0 likes
•
42 views
K
keisunagawa
Follow
Elixir-Slackライブラリを使い、Slack上にScalaのREPL botを作った話です
Read less
Read more
Engineering
Slideshow view
Report
Share
Slideshow view
Report
Share
1 of 9
Download now
Download to read offline
Recommended
Build Dockferile with Haskell
Build Dockferile with Haskell
Nobutada Matsubara
Akka入門
Akka入門
Masashi (Jangsa) Kawaguchi
実践Akka
実践Akka
Huy Do
関数型もモナドも分からなくてもScalaと言う言語は便利らしい
関数型もモナドも分からなくてもScalaと言う言語は便利らしい
ke-m kamekoopa
akka-doc-ja
akka-doc-ja
TIS Inc.
並行処理初心者のためのAkka入門
並行処理初心者のためのAkka入門
Yoshimura Soichiro
Quasar: Actor Model and Light Weight Threads on Java
Quasar: Actor Model and Light Weight Threads on Java
Taku Miyakawa
The state of sbt 0.13, sbt server, and sbt 1.0 (ScalaMatsuri ver)
The state of sbt 0.13, sbt server, and sbt 1.0 (ScalaMatsuri ver)
Eugene Yokota
Recommended
Build Dockferile with Haskell
Build Dockferile with Haskell
Nobutada Matsubara
Akka入門
Akka入門
Masashi (Jangsa) Kawaguchi
実践Akka
実践Akka
Huy Do
関数型もモナドも分からなくてもScalaと言う言語は便利らしい
関数型もモナドも分からなくてもScalaと言う言語は便利らしい
ke-m kamekoopa
akka-doc-ja
akka-doc-ja
TIS Inc.
並行処理初心者のためのAkka入門
並行処理初心者のためのAkka入門
Yoshimura Soichiro
Quasar: Actor Model and Light Weight Threads on Java
Quasar: Actor Model and Light Weight Threads on Java
Taku Miyakawa
The state of sbt 0.13, sbt server, and sbt 1.0 (ScalaMatsuri ver)
The state of sbt 0.13, sbt server, and sbt 1.0 (ScalaMatsuri ver)
Eugene Yokota
2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot
Marius Sescu
Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPT
Expeed Software
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage Engineerings
Pixeldarts
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
ThinkNow
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
marketingartwork
Skeleton Culture Code
Skeleton Culture Code
Skeleton Technologies
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
Neil Kimberley
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
contently
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
Albert Qian
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
Kurio // The Social Media Age(ncy)
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
Search Engine Journal
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
SpeakerHub
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
Clark Boyd
Getting into the tech field. what next
Getting into the tech field. what next
Tessa Mero
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Lily Ray
How to have difficult conversations
How to have difficult conversations
Rajiv Jayarajah, MAppComm, ACC
Introduction to Data Science
Introduction to Data Science
Christy Abraham Joy
Time Management & Productivity - Best Practices
Time Management & Productivity - Best Practices
Vit Horky
The six step guide to practical project management
The six step guide to practical project management
MindGenius
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
RachelPearson36
More Related Content
Featured
2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot
Marius Sescu
Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPT
Expeed Software
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage Engineerings
Pixeldarts
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
ThinkNow
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
marketingartwork
Skeleton Culture Code
Skeleton Culture Code
Skeleton Technologies
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
Neil Kimberley
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
contently
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
Albert Qian
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
Kurio // The Social Media Age(ncy)
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
Search Engine Journal
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
SpeakerHub
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
Clark Boyd
Getting into the tech field. what next
Getting into the tech field. what next
Tessa Mero
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Lily Ray
How to have difficult conversations
How to have difficult conversations
Rajiv Jayarajah, MAppComm, ACC
Introduction to Data Science
Introduction to Data Science
Christy Abraham Joy
Time Management & Productivity - Best Practices
Time Management & Productivity - Best Practices
Vit Horky
The six step guide to practical project management
The six step guide to practical project management
MindGenius
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
RachelPearson36
Featured
(20)
2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot
Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPT
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage Engineerings
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
Skeleton Culture Code
Skeleton Culture Code
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
Getting into the tech field. what next
Getting into the tech field. what next
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
How to have difficult conversations
How to have difficult conversations
Introduction to Data Science
Introduction to Data Science
Time Management & Productivity - Best Practices
Time Management & Productivity - Best Practices
The six step guide to practical project management
The six step guide to practical project management
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Elixirでslackのbotを作った話
1.
Elixirでslackのbotを作った話
2.
★ 作ったもの slackでメンション付けてscalaのコードを投げると結果を返してくれるbot
3.
★ 使ったもの ● Elixir(言語)[https://elixir-lang.org/] ●
Elixir-Slack[https://github.com/BlakeWilliams/Elixir-Slack] ● ammonite(scala-REPL)[http://ammonite.io/]
4.
★ Elixirについてちょっとだけ ● Erlangという言語のVM上で動く(ErlangとElixirの関係性はJavaとscalaみたいなも の) ●
関数型言語 ● パターンマッチがつよい ● 耐障害性が高い ● 並列処理に強い ● アクターモデルを実装している
5.
★ アクターモデル アクターと呼ばれるオブジェクトが互いのメールボックスにメッセージを送り合う、アク ターは自身のメールボックスに届いたメッセージを到着順に処理する (各アクターでの処理は並列で行われる) 〒 アクター メールボックスと呼ばれる専用のメッ セージキューを持つ メールボックス 他のアクターから受け取ったメッセー ジが到着順に格納される 〒 〒 互いにメッセージを 送り合う 実装上でのメッセージは文字列だけでなく ListやTuple,Mapなど値として扱えるもの ならなんでも送れる メッセージが到着すると 予め定義した処理が実 行される
6.
★ 今回作ったSlackBotの構成 だいたいこんなかんじ ErlangVMSlack slackクライアント アクター slack上でのイベント (メッ セージの送信など
)が通 知される メッセージフィルタ/コ ンバータ アクター スーパバイザ メッセージが自分宛てのもの かを判定し、自分宛てのメッ セージの場合は後続のアク ターが処理できるように変換 する REPLクライアント アクター ScalaREPL (ammonite) REPLにscalaのコードを送信 し、結果を取得する REPLから正常な結果を得ら れなかった場合は死ぬ 各アクターが異常終了を 検知し、自動で再起動を する
7.
★ Elixir使って良かったところ ● 並列化が容易 ●
例外処理のハンドリングが楽 ● 文字列をそのままパターンマッチ出来るのでメッセージのパースが楽 make_response関数の第一引数に与えた文字列によって 呼び出される関数が変わる
8.
★ Elixirを使って良くなかったところ ● ActorModel,
GenServer, Supervisor, Mix などマトモなアプリケーションを書ける までに覚えることは多い ● 一部構文が少しわかりにくい(ライブラリのコードとか見るのがちょい辛い) ● Mapの更新 ● シギル (全部同じ意味!!) ● 無名関数(&記法)
9.
ご清聴ありがとうございました
Download now