summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul J. Davis <paul.joseph.davis@gmail.com>2017-05-30 11:27:08 -0500
committerPaul J. Davis <paul.joseph.davis@gmail.com>2017-05-30 11:27:08 -0500
commitfe02bcc8222e9559af5d70e38f0c11b87bd8d95d (patch)
tree7cc232ba7a50e5a2123b39814fb15bb3e628809e
parent9b4a4f9698e4b21f6738b9539dd57d56850f22f2 (diff)
downloadcouchdb-fe02bcc8222e9559af5d70e38f0c11b87bd8d95d.tar.gz
Rename handle_call and handle_info callbacks
This is to avoid clashing with the gen behavior callbacks in case someone ever decides to mix couch_db_engine and gen behaviors in a single module.
-rw-r--r--src/couch/src/couch_bt_engine.erl8
-rw-r--r--src/couch/src/couch_db_engine.erl16
-rw-r--r--src/couch/src/couch_db_updater.erl4
3 files changed, 14 insertions, 14 deletions
diff --git a/src/couch/src/couch_bt_engine.erl b/src/couch/src/couch_bt_engine.erl
index 068d3c9ef..a5318cd25 100644
--- a/src/couch/src/couch_bt_engine.erl
+++ b/src/couch/src/couch_bt_engine.erl
@@ -21,8 +21,8 @@
init/2,
terminate/2,
- handle_call/2,
- handle_info/2,
+ handle_db_updater_call/2,
+ handle_db_updater_info/2,
incref/1,
decref/1,
@@ -162,11 +162,11 @@ terminate(_Reason, St) ->
ok.
-handle_call(Msg, St) ->
+handle_db_updater_call(Msg, St) ->
{stop, {invalid_call, Msg}, {invalid_call, Msg}, St}.
-handle_info({'DOWN', Ref, _, _, _}, #st{fd_monitor=Ref} = St) ->
+handle_db_updater_info({'DOWN', Ref, _, _, _}, #st{fd_monitor=Ref} = St) ->
{stop, normal, St#st{fd=undefined, fd_monitor=closed}}.
diff --git a/src/couch/src/couch_db_engine.erl b/src/couch/src/couch_db_engine.erl
index d78891293..7271f3aa0 100644
--- a/src/couch/src/couch_db_engine.erl
+++ b/src/couch/src/couch_db_engine.erl
@@ -140,14 +140,14 @@
% This is called in the context of couch_db_updater:handle_call/3
% for any message that is unknown. It can be used to handle messages
% from asynchronous processes like the engine's compactor if it has one.
--callback handle_call(Msg::any(), DbHandle::db_handle()) ->
+-callback handle_db_updater_call(Msg::any(), DbHandle::db_handle()) ->
{reply, Resp::any(), NewDbHandle::db_handle()} |
{stop, Reason::any(), Resp::any(), NewDbHandle::db_handle()}.
% This is called in the context of couch_db_updater:handle_info/2
% and has the same properties as handle_call/3.
--callback handle_info(Msg::any(), DbHandle::db_handle()) ->
+-callback handle_db_updater_info(Msg::any(), DbHandle::db_handle()) ->
{noreply, NewDbHandle::db_handle()} |
{noreply, NewDbHandle::db_handle(), Timeout::timeout()} |
{stop, Reason::any(), NewDbHandle::db_handle()}.
@@ -573,8 +573,8 @@
init/3,
terminate/2,
- handle_call/3,
- handle_info/2,
+ handle_db_updater_call/3,
+ handle_db_updater_info/2,
incref/1,
decref/1,
@@ -647,11 +647,11 @@ terminate(Reason, #db{} = Db) ->
Engine:terminate(Reason, EngineState).
-handle_call(Msg, _From, #db{} = Db) ->
+handle_db_updater_call(Msg, _From, #db{} = Db) ->
#db{
engine = {Engine, EngineState}
} = Db,
- case Engine:handle_call(Msg, EngineState) of
+ case Engine:handle_db_updater_call(Msg, EngineState) of
{reply, Resp, NewState} ->
{reply, Resp, Db#db{engine = {Engine, NewState}}};
{stop, Reason, Resp, NewState} ->
@@ -659,12 +659,12 @@ handle_call(Msg, _From, #db{} = Db) ->
end.
-handle_info(Msg, #db{} = Db) ->
+handle_db_updater_info(Msg, #db{} = Db) ->
#db{
name = Name,
engine = {Engine, EngineState}
} = Db,
- case Engine:handle_info(Msg, EngineState) of
+ case Engine:handle_db_updater_info(Msg, EngineState) of
{noreply, NewState} ->
{noreply, Db#db{engine = {Engine, NewState}}};
{noreply, NewState, Timeout} ->
diff --git a/src/couch/src/couch_db_updater.erl b/src/couch/src/couch_db_updater.erl
index dd5b4e739..ddf15a24b 100644
--- a/src/couch/src/couch_db_updater.erl
+++ b/src/couch/src/couch_db_updater.erl
@@ -166,7 +166,7 @@ handle_call({purge_docs, IdRevs}, _From, Db) ->
{reply, {ok, PurgeSeq, PurgedIdRevs}, Db2};
handle_call(Msg, From, Db) ->
- couch_db_engine:handle_call(Msg, From, Db).
+ couch_db_engine:handle_db_updater_call(Msg, From, Db).
handle_cast({load_validation_funs, ValidationFuns}, Db) ->
@@ -267,7 +267,7 @@ handle_info({'EXIT', _Pid, normal}, Db) ->
handle_info({'EXIT', _Pid, Reason}, Db) ->
{stop, Reason, Db};
handle_info(Msg, Db) ->
- couch_db_engine:handle_info(Msg, Db).
+ couch_db_engine:handle_db_updater_info(Msg, Db).
code_change(_OldVsn, State, _Extra) ->
{ok, State}.