Skip to content

Commit

Permalink
Adds logplex_tail:shutdown/1.
Browse files Browse the repository at this point in the history
  • Loading branch information
archaelus committed Jul 16, 2012
1 parent 89e69ba commit 62e92b6
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/logplex_tail.erl
Expand Up @@ -28,6 +28,7 @@
handle_info/2, terminate/2, code_change/3]).

-export([register/1, route/2]).
-export([shutdown/1]).

-include_lib("logplex.hrl").

Expand All @@ -44,6 +45,13 @@ route(ChannelId, Msg) when is_integer(ChannelId), is_binary(Msg) ->
[Pid ! {log, Msg} || {_ChannelId, Pid} <- ets:lookup(?MODULE, ChannelId)],
ok.

%% @doc Shut down a running tail - intended for use when no_tail is
%% added to a channel.
shutdown(ChannelId) when is_integer(ChannelId) ->
[exit(Pid, shutdown)
|| {_ChannelId, Pid} <- ets:lookup(?MODULE, ChannelId)],
ok.

%%====================================================================
%% gen_server callbacks
%%====================================================================
Expand Down

0 comments on commit 62e92b6

Please sign in to comment.