Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

API to set global age of channels during runtime

This will change the maximum age of the channel to NewMaxAge.
Note: Channels created prior to this call will not have any effect.
  • Loading branch information...
commit 8b737765345c441db17e59a7777cc7eef8d88638 1 parent 0d563ff
@marutha marutha authored
Showing with 8 additions and 1 deletion.
  1. +8 −1 src/tinymq.erl
View
9 src/tinymq.erl
@@ -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.