couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From vatam...@apache.org
Subject [couchdb] 01/02: Expose mem3_shards:get_changes_pid/0
Date Wed, 10 May 2017 16:16:15 GMT
This is an automated email from the ASF dual-hosted git repository.

vatamane pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/couchdb.git

commit 9d99d6e8ef9b7076b9a25cffcb9ebd08655bbef6
Author: Jay Doane <jay.s.doane@gmail.com>
AuthorDate: Sun May 7 22:49:06 2017 -0700

    Expose mem3_shards:get_changes_pid/0
    
    Simplify getting changes listener pid for testing
---
 src/mem3/src/mem3_shards.erl | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/src/mem3/src/mem3_shards.erl b/src/mem3/src/mem3_shards.erl
index 3c2001b..a419e45 100644
--- a/src/mem3/src/mem3_shards.erl
+++ b/src/mem3/src/mem3_shards.erl
@@ -23,6 +23,7 @@
 -export([for_db/1, for_db/2, for_docid/2, for_docid/3, get/3, local/1, fold/2]).
 -export([for_shard_name/1]).
 -export([set_max_size/1]).
+-export([get_changes_pid/0]).
 
 -record(st, {
     max_size = 25000,
@@ -169,6 +170,9 @@ fold(Fun, Acc) ->
 set_max_size(Size) when is_integer(Size), Size > 0 ->
     gen_server:call(?MODULE, {set_max_size, Size}).
 
+get_changes_pid() ->
+    gen_server:call(?MODULE, get_changes_pid).
+
 handle_config_change("mem3", "shard_cache_size", SizeList, _, _) ->
     Size = list_to_integer(SizeList),
     {ok, gen_server:call(?MODULE, {set_max_size, Size}, infinity)};
@@ -219,6 +223,8 @@ handle_call(shard_db_changed, _From, St) ->
     {reply, ok, St};
 handle_call({set_write_timeout, Timeout}, _From, St) ->
     {reply, ok, St#st{write_timeout = Timeout}};
+handle_call(get_changes_pid, _From, St) ->
+    {reply, {ok, St#st.changes_pid}, St};
 handle_call(_Call, _From, St) ->
     {noreply, St}.
 

-- 
To stop receiving notification emails like this one, please contact
"commits@couchdb.apache.org" <commits@couchdb.apache.org>.

Mime
View raw message