Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Distributed PubSub and Presence platform for the Phoenix Framework

License

NotificationsYou must be signed in to change notification settings

phoenixframework/phoenix_pubsub

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Distributed PubSub and Presence platform for the Phoenix Framework

Build Status

Usage

Addphoenix_pubsub to your list of dependencies inmix.exs:

defdepsdo[{:phoenix_pubsub,"~> 2.0"}]end

Then start your PubSub instance:

defmoduleMyAppdouseApplicationdefstart(_type,_args)dochildren=[{Phoenix.PubSub,name:MyApp.PubSub}]opts=[strategy::one_for_one,name:MyApp.Supervisor]Supervisor.start_link(children,opts)endend

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 theclustered tag:

$ mixtest --exclude clustered

If you have issues running the clustered tests try running:

$ epmd -daemon

before running the tests.

About

Distributed PubSub and Presence platform for the Phoenix Framework

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages


[8]ページ先頭

©2009-2025 Movatter.jp