fix subscription
This commit is contained in:
parent
fc338360b9
commit
f9690fc81f
@ -13,6 +13,7 @@
|
||||
|
||||
%% API
|
||||
-export([start_link/0]).
|
||||
-export([subscribe/2, publish/2]).
|
||||
-export([match_components/2, match_topic/2, is_valid_components/1, of_components/1]).
|
||||
|
||||
%% gen_server callbacks
|
||||
@ -35,9 +36,11 @@
|
||||
%%% API
|
||||
%%%===================================================================
|
||||
|
||||
-spec subscribe(Topic :: binary(), SubscriberPid :: pid()) -> no_return().
|
||||
subscribe(Topic, SubscriberPid) when is_binary(Topic), is_pid(SubscriberPid) ->
|
||||
gen_server:cast(?SERVER, {subscribe, Topic, SubscriberPid}).
|
||||
|
||||
-spec publish(Topic :: binary(), Content :: binary()) -> no_return().
|
||||
publish(Topic, Content) when is_binary(Topic), is_binary(Content) ->
|
||||
gen_server:cast(?SERVER, {publish, Topic, Content}).
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user