Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add get_members to return list of subscribers #75

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion src/sibyl_bus.erl
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
start/0,
sub/2,
pub/2,
leave/2
leave/2,
get_members/1
]).

%% if release not defined default to 20, should be defined from otp21 and up
Expand All @@ -31,6 +32,9 @@ pub(Topic, Message) ->
Members = pg:get_local_members(Topic),
send_to_members(Members, Message).

get_members(Topic) ->
pg:get_members(Topic).

-else.

start() ->
Expand All @@ -53,6 +57,9 @@ pub(Topic, Message) ->
send_to_members(Members, Message)
end.

get_members(Topic) ->
pg2:get_members(Topic).

-endif.

%% private functions
Expand Down