#38: Chat Room in 8 Minutes Published March 19, 2018 Elixir 1.5 Phoenix 1.3 View source on GitHub Phoenix is the most popular Framework for web development in Elixir. And one of it’s most exciting parts is the ability to add realtime functionality, which we can do with Channels. In this episode let’s see how can build a simple chat application with Phoenix using websockets. Let’s start this from p
8. Delicate Chatとは? ● Phoenixを使ったシンプルなWebチャット ● 特徴 ○ サーバサイドのElixirでの実装が「Erlang In Anger」での「してはいけ ないこと(アンチパターン)」を活用して実装されている。 ○ そのアンチパターンが原因のシステム障害を体験できる。 10. ● 「Erlang In Anger」から引用 ○ > Don’t use dynamic atoms! ○ > If you use the xmerl library that ships with Erlang, consider open source alternatives or figuring the way to add your own SAX parser that can be safe . つまり、アンチパターン的には、xmerlを使ってそれにユーザーの
昨今のWebアプリケーションでは、クライアント、サーバが常時接続してメッセージ通信をすることが求められてきています (リアルタイムWebアプリケーションと呼ばれたりします)。 このアプリケーションには以下の特徴があります クライアント、サーバが常時接続 クライアントからではなく、サーバから接続しているクライアントへ情報をプッシュする 通信の頻度が多い 今回はこのような常時接続型のアプリケーションを実現するために作られたWebSocketの説明と、PhoenixでWebSocketをどのように使って常時接続のアプリケーションを作るか説明します。 WebSoketが必要とされてきた背景 今までのWebアプリケーションのリクエスト/レスポンス処理は以下のようなアーキテクチャでした。 全てのリクエストは状態を持たない サーバはリクエストを毎回新しいものとして扱う(HTTPはもともとステートレスなプ
SlackのBotを簡単に構築できるライブラリを作りました。 私が調べた限り、ElixirにはSlackのBotを作るライブラリとして、 Elixir-Slack、slackerがありますが、求めているものとしてこれでは足りなかったためslackerの上に構築しました。 それがこちらです。 Sloth 使い方と構成、仕組みの解説をしたいと思います。 HowTo defmodule Echo do use Sloth.Plugin plugin ~r/^echo (.*)$/, :echo def echo(send_data, captures \\ []) do Sloth.Slacker.say(send_data["channel"], List.first(captures)) end end 上記sampleは、echo ほげほげのような発言に対して、 ほげほげと返すBotです。
前々回の記事は「Phoenix環境のセットアップから、静的ページを作成し、表示」させました。 前回の記事では、「Phoenixで認証機能を実装」しました。 今回の記事では、入門最後として「Phoenixでチャット機能を実装」します。 Phoenixでソケット、チャネル、トークン、API作成、モデルのアソシエーションなどを行っていきます。 サンプル ChatPhoenix - Heroku ChatPhoenix - GitHub 目次 ソケットの基礎用語 チャット機能の追加 チャット機能をログイン機能と統合 チャットメッセージの永続化 動作確認 Erlang 7.1 Elixir 1.1.1 Phoenix 10.0.3 Hex 0.9.0 node.js 0.12.7 npm 2.14.2 PostgreSQL 9.4.4 1. ソケットの基礎用語ソケットの基本的な用語について簡単に記載
Building a Simple Chat App in Elixir With Phoenix and RethinkDB In this post we will explore how to connect RethinkDBs changefeeds to Phoenix’s channels. We are going to build a chat app that stores messages in a RethinkDB database. When a user connects, we listen to a changefeed on the database. As soon as a new message row is inserted into the database, we push the JSON we receive from the chang
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く