Permalink
Browse files

clarified documentation

  • Loading branch information...
1 parent a1b0f25 commit ce31d75bef7ecf6b426e13537a90f796cb8f15ce @uwiger uwiger committed with Jul 5, 2012
Showing with 12 additions and 4 deletions.
  1. +12 −4 src/gproc_ps.erl
View
16 src/gproc_ps.erl
@@ -64,11 +64,15 @@
-spec subscribe(scope(), event()) -> true.
%% @doc Subscribe to events of type `Event'
%%
-%% Any messages published with `gproc_ps:publish(Scope, Event, Msg)' will be delivered to
-%% the current process, along with all other subscribers.
+%% Any messages published with `gproc_ps:publish(Scope, Event, Msg)' will be
+%% delivered to the current process, along with all other subscribers.
%%
-%% This function creates a property, `{p,Scope,{gproc_ps_event,Event}}', which can be
-%% searched and displayed for debugging purposes.
+%% This function creates a property, `{p,Scope,{gproc_ps_event,Event}}', which
+%% can be searched and displayed for debugging purposes.
+%%
+%% Note that, as with {@link gproc:reg/1}, this function will raise an
+%% exception if you try to subscribe to the same event twice from the same
+%% process.
%% @end
subscribe(Scope, Event) when Scope==l; Scope==g ->
gproc:reg({p,Scope,{?ETag, Event}}).
@@ -95,6 +99,10 @@ subscribe(Scope, Event) when Scope==l; Scope==g ->
%%
%% This means that `Cond=undefined' and ``Cond=[{'_',[],[true]}]'' are
%% equivalent.
+%%
+%% Note that, as with {@link gproc:reg/1}, this function will raise an
+%% exception if you try to subscribe to the same event twice from the same
+%% process.
%% @end
subscribe_cond(Scope, Event, Spec) when Scope==l; Scope==g ->
case Spec of

0 comments on commit ce31d75

Please sign in to comment.