couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rnew...@apache.org
Subject [1/2] couchdb-global-changes git commit: Update to new couch_epi API
Date Thu, 01 Oct 2015 15:04:39 GMT
Repository: couchdb-global-changes
Updated Branches:
  refs/heads/master 16d0200bc -> 07097ce3e


Update to new couch_epi API


Project: http://git-wip-us.apache.org/repos/asf/couchdb-global-changes/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb-global-changes/commit/349b3079
Tree: http://git-wip-us.apache.org/repos/asf/couchdb-global-changes/tree/349b3079
Diff: http://git-wip-us.apache.org/repos/asf/couchdb-global-changes/diff/349b3079

Branch: refs/heads/master
Commit: 349b3079af9e3b1e752328abcc2cf92debbf8847
Parents: 16d0200
Author: ILYA Khlopotov <iilyak@ca.ibm.com>
Authored: Mon Sep 28 09:48:59 2015 -0700
Committer: ILYA Khlopotov <iilyak@ca.ibm.com>
Committed: Mon Sep 28 09:48:59 2015 -0700

----------------------------------------------------------------------
 src/global_changes_epi.erl | 51 +++++++++++++++++++++++++++++++++++++++++
 src/global_changes_sup.erl |  7 ++----
 2 files changed, 53 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb-global-changes/blob/349b3079/src/global_changes_epi.erl
----------------------------------------------------------------------
diff --git a/src/global_changes_epi.erl b/src/global_changes_epi.erl
new file mode 100644
index 0000000..5d8cbf9
--- /dev/null
+++ b/src/global_changes_epi.erl
@@ -0,0 +1,51 @@
+% Licensed under the Apache License, Version 2.0 (the "License"); you may not
+% use this file except in compliance with the License. You may obtain a copy of
+% the License at
+%
+% http://www.apache.org/licenses/LICENSE-2.0
+%
+% Unless required by applicable law or agreed to in writing, software
+% distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+% WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+% License for the specific language governing permissions and limitations under
+% the License.
+
+-module(global_changes_epi).
+
+-behaviour(couch_epi_plugin).
+
+-export([
+    app/0,
+    providers/0,
+    services/0,
+    data_subscriptions/0,
+    data_providers/0,
+    processes/0,
+    notify/3
+]).
+
+app() ->
+    global_changes.
+
+providers() ->
+    [
+        {chttpd_handlers, global_changes_httpd_handlers}
+    ].
+
+
+services() ->
+    [
+        {global_changes, global_changes_plugin}
+    ].
+
+data_subscriptions() ->
+    [].
+
+data_providers() ->
+    [].
+
+processes() ->
+    [].
+
+notify(_Key, _Old, _New) ->
+    ok.

http://git-wip-us.apache.org/repos/asf/couchdb-global-changes/blob/349b3079/src/global_changes_sup.erl
----------------------------------------------------------------------
diff --git a/src/global_changes_sup.erl b/src/global_changes_sup.erl
index aed424e..6e61595 100644
--- a/src/global_changes_sup.erl
+++ b/src/global_changes_sup.erl
@@ -24,10 +24,9 @@ start_link() ->
 
 
 init([]) ->
-    couch_epi:register_service(global_changes),
     global_changes_config_listener:subscribe(),
     {ok, {
-        {one_for_one, 5, 10}, [
+        {one_for_one, 5, 10}, couch_epi:register_service(global_changes_epi) ++ [
             {
                 global_changes_server,
                 {global_changes_server, start_link, []},
@@ -35,7 +34,5 @@ init([]) ->
                 5000,
                 worker,
                 [global_changes_server]
-            },
-            chttpd_handlers:provider(
-                global_changes, global_changes_httpd_handlers)
+            }
     ]}}.


Mime
View raw message