Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge pull request #10 from maruthavanan/patch-1

API to set global age of channels during runtime
  • Loading branch information...
commit 0b85e33dd56e2e33f23b7428e4b83e4a7b00929b 2 parents 0d563ff + 8b73776
Evan Miller evanmiller authored
Showing with 8 additions and 1 deletion.
  1. +8 −1 src/tinymq.erl
9 src/tinymq.erl
View
@@ -1,6 +1,6 @@
-module(tinymq).
--export([now/1, poll/2, subscribe/3, push/2]).
+-export([now/1, poll/2, subscribe/3, push/2,set_global_age/1]).
%% @spec subscribe(Channel::string(), Timestamp::integer() | now | last, Subscriber::pid()) -> {ok, SubscribeTime} | {error, Reason}
%% @doc Check `Channel' for messages created since `Timestamp' and send
@@ -25,3 +25,10 @@ push(Channel, Message) ->
%% @doc Retrieve the current time for the server managing `Channel'.
now(Channel) ->
gen_server:call(tinymq, {now, Channel}).
+
+%% @spec set_global_age(NewMaxAge) -> ok
+%% @doc Set new maximum age globally
+%% This will change the maximum age of the channel to NewMaxAge.
+%% Note: Channels created prior to this call will not have any effect.
+set_global_age(NewMaxAge) ->
+ gen_server:cast(tinymq, {set_max_age, NewMaxAge}).
Please sign in to comment.
Something went wrong with that request. Please try again.