• Stars
    star
    611
  • Rank 70,518 (Top 2 %)
  • Language
    Elixir
  • License
    MIT License
  • Created over 8 years ago
  • Updated 4 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Distributed PubSub and Presence platform for the Phoenix Framework

Phoenix.PubSub

Distributed PubSub and Presence platform for the Phoenix Framework

Build Status

Usage

Add phoenix_pubsub to your list of dependencies in mix.exs:

def deps do
  [{:phoenix_pubsub, "~> 2.0"}]
end

Then start your PubSub instance:

defmodule MyApp do
  use Application

  def start(_type, _args) do
    children = [
      {Phoenix.PubSub, name: MyApp.PubSub}
    ]

    opts = [strategy: :one_for_one, name: MyApp.Supervisor]
    Supervisor.start_link(children, opts)
  end
end

Now broadcast and subscribe:

Phoenix.PubSub.subscribe(MyApp.PubSub, "user:123")
Phoenix.PubSub.broadcast(MyApp.PubSub, "user:123", :hello_world)

Testing

Testing by default spawns nodes internally for distributed tests. To run tests that do not require clustering, exclude the clustered tag:

$ mix test --exclude clustered

If you have issues running the clustered tests try running:

$ epmd -daemon

before running the tests.

More Repositories

1

phoenix

Peace of mind from prototype to production
Elixir
20,545
star
2

phoenix_live_view

Rich, real-time user experiences with server-rendered HTML
Elixir
5,741
star
3

phoenix_live_dashboard

Realtime dashboard with metrics, request logging, plus storage, OS and VM insights
Elixir
1,925
star
4

flame

Elixir
607
star
5

phoenix_guides

User guides for the Phoenix web development framework.
499
star
6

tailwind

An installer for tailwind
Elixir
461
star
7

phoenix_ecto

Phoenix and Ecto integration with support for concurrent acceptance testing
Elixir
437
star
8

phoenix_html

Building blocks for working with HTML in Phoenix
Elixir
379
star
9

phoenix_live_reload

Provides live-reload functionality for Phoenix
Elixir
289
star
10

firenest

Elixir
271
star
11

esbuild

An installer for esbuild
Elixir
261
star
12

phoenix_pubsub_redis

The Redis PubSub adapter for the Phoenix framework
Elixir
174
star
13

dns_cluster

Simple DNS clustering for distributed Elixir nodes
Elixir
162
star
14

vscode-phoenix

Syntax highlighting support for Phoenix templates in Visual Studio Code.
155
star
15

plds

CLI version of Phoenix LiveDashboard
Elixir
85
star
16

websock

A specification for Elixir apps to service WebSocket connections
Elixir
70
star
17

phoenix_view

View abstraction for Phoenix v1.0-v1.6
Elixir
64
star
18

tree-sitter-heex

HEEx grammer for Tree-sitter
JavaScript
48
star
19

phoenix_template

Template rendering for Phoenix
Elixir
48
star
20

ex_conf

Simple Elixir Configuration Management
Elixir
35
star
21

archives

Holds archives for released Phoenix versions
27
star
22

websock_adapter

Implementation of the WebSock specification for servers
Elixir
25
star
23

phoenix_site

CSS
13
star
24

phoenix_html_helpers

Collection of helpers to generate and manipulate HTML contents
Elixir
13
star
25

media

Phoenix Related Media
10
star
26

node_checker

Elixir
3
star