summaryrefslogtreecommitdiff
path: root/apps
diff options
context:
space:
mode:
authorAdam Kocoloski <adam@cloudant.com>2010-10-21 21:48:39 -0400
committerAdam Kocoloski <adam@cloudant.com>2010-10-21 21:48:39 -0400
commitb25b5b1966960a580293a0bdefcf8d290efe9b4d (patch)
treecf0b27ef309efc4ba42b9476e907c9f17a8825f5 /apps
parent32f2dd98328c99b4ca80e907d7d164cf44c02824 (diff)
use erlang:send_after/3 instead of timer version
http://www.erlang.org/doc/efficiency_guide/commoncaveats.html#id52228
Diffstat (limited to 'apps')
-rw-r--r--apps/couch/src/couch_file.erl4
-rw-r--r--apps/mem3/src/mem3_cache.erl2
-rw-r--r--apps/mem3/src/mem3_nodes.erl2
-rw-r--r--apps/rexi/src/rexi_utils.erl2
4 files changed, 5 insertions, 5 deletions
diff --git a/apps/couch/src/couch_file.erl b/apps/couch/src/couch_file.erl
index 2d539f64..b3d91bb4 100644
--- a/apps/couch/src/couch_file.erl
+++ b/apps/couch/src/couch_file.erl
@@ -237,7 +237,7 @@ init_status_error(ReturnPid, Ref, Error) ->
init({Filepath, Options, ReturnPid, Ref}) ->
process_flag(trap_exit, true),
- timer:send_after(60000, maybe_close),
+ erlang:send_after(60000, self(), maybe_close),
case lists:member(create, Options) of
true ->
filelib:ensure_dir(Filepath),
@@ -489,7 +489,7 @@ handle_info(maybe_close, Fd) ->
[?MODULE, self()]),
{stop, normal, Fd};
_Else ->
- timer:send_after(10000, maybe_close),
+ erlang:send_after(10000, self(), maybe_close),
{noreply, Fd}
end;
handle_info({'EXIT', _, normal}, Fd) ->
diff --git a/apps/mem3/src/mem3_cache.erl b/apps/mem3/src/mem3_cache.erl
index 419e0d7c..6614c29e 100644
--- a/apps/mem3/src/mem3_cache.erl
+++ b/apps/mem3/src/mem3_cache.erl
@@ -45,7 +45,7 @@ handle_info({'DOWN', _, _, Pid, {badarg, [{ets,delete,[partitions,_]}|_]}},
handle_info({'DOWN', _, _, Pid, Reason}, #state{changes_pid=Pid} = State) ->
?LOG_INFO("~p changes listener died ~p", [?MODULE, Reason]),
Seq = case Reason of {seq, EndSeq} -> EndSeq; _ -> 0 end,
- timer:send_after(5000, {start_listener, Seq}),
+ erlang:send_after(5000, self(), {start_listener, Seq}),
{noreply, State};
handle_info({start_listener, Seq}, State) ->
{NewPid, _} = spawn_monitor(fun() -> listen_for_changes(Seq) end),
diff --git a/apps/mem3/src/mem3_nodes.erl b/apps/mem3/src/mem3_nodes.erl
index c8528cb6..f9320598 100644
--- a/apps/mem3/src/mem3_nodes.erl
+++ b/apps/mem3/src/mem3_nodes.erl
@@ -53,7 +53,7 @@ handle_info({'DOWN', _, _, Pid, Reason}, #state{changes_pid=Pid} = State) ->
?LOG_INFO("~p changes listener died ~p", [?MODULE, Reason]),
StartSeq = State#state.update_seq,
Seq = case Reason of {seq, EndSeq} -> EndSeq; _ -> StartSeq end,
- timer:send_after(5000, start_listener),
+ erlang:send_after(5000, self(), start_listener),
{noreply, State#state{update_seq = Seq}};
handle_info(start_listener, #state{update_seq = Seq} = State) ->
{NewPid, _} = spawn_monitor(fun() -> listen_for_changes(Seq) end),
diff --git a/apps/rexi/src/rexi_utils.erl b/apps/rexi/src/rexi_utils.erl
index 79183951..1e8820e1 100644
--- a/apps/rexi/src/rexi_utils.erl
+++ b/apps/rexi/src/rexi_utils.erl
@@ -9,7 +9,7 @@ recv(Refs, Keypos, Fun, Acc0, infinity, PerMsgTO) ->
process_mailbox(Refs, Keypos, Fun, Acc0, nil, PerMsgTO);
recv(Refs, Keypos, Fun, Acc0, GlobalTimeout, PerMsgTO) ->
TimeoutRef = erlang:make_ref(),
- {ok, TRef} = timer:send_after(GlobalTimeout, {timeout, TimeoutRef}),
+ {ok, TRef} = erlang:send_after(GlobalTimeout, self(), {timeout, TimeoutRef}),
try
process_mailbox(Refs, Keypos, Fun, Acc0, TimeoutRef, PerMsgTO)
after