Skip to content

shizzard/ebus

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Erlang internal pubsub server

This server is very simple; what it does is:

  • handling subscribers pids in channel state
  • publishing a message in a simple list comprehension

Channel name is always binary string.

Usage

(ebus@shizz-laptop)1> C = <<"channel-1">>.
<<"channel-1">>
(ebus@shizz-laptop)2> ebus:start(C).
{ok,<<"channel-1">>}
(ebus@shizz-laptop)3> ebus:subscribe(C).
{ok,<<"channel-1">>}
(ebus@shizz-laptop)4> ebus:publish(C, {message, test}).
{ok,<<"channel-1">>}
(ebus@shizz-laptop)5> flush().
Shell got {message,test}
ok
(ebus@shizz-laptop)6> ebus:unsubscribe(C).             
{ok,<<"channel-1">>}
(ebus@shizz-laptop)7> ebus:publish(C, {message, test}).
{ok,<<"channel-1">>}
(ebus@shizz-laptop)8> flush().                         
ok

About

Erlang internal pubsub server

Resources

Stars

Watchers

Forks

Packages

No packages published