Skip to content


Subversion checkout URL

You can clone with
Download ZIP
Browse files

Merge pull request #10 from maruthavanan/patch-1

API to set global age of channels during runtime
  • Loading branch information...
2 parents 0d563ff + 8b73776 commit 0b85e33dd56e2e33f23b7428e4b83e4a7b00929b @evanmiller evanmiller committed
Showing with 8 additions and 1 deletion.
  1. +8 −1 src/tinymq.erl
9 src/tinymq.erl
@@ -1,6 +1,6 @@
--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}).

0 comments on commit 0b85e33

Please sign in to comment.
Something went wrong with that request. Please try again.