diff options
author | iilyak <iilyak@users.noreply.github.com> | 2018-11-23 11:39:24 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-11-23 11:39:24 -0800 |
commit | 2e22aa6ed2dd935f4f5eb67ac83c908ae6472b1b (patch) | |
tree | c3595b8425b92fc2ef5783a3757bbad894d46410 | |
parent | 81f7904b3fcaad18f0376c72d1a71c65f9f0cadf (diff) | |
parent | a60655b43ab14db5b3368b2781b47d08d5bc45c3 (diff) | |
download | couchdb-2e22aa6ed2dd935f4f5eb67ac83c908ae6472b1b.tar.gz |
Merge pull request #1761 from cloudant/fix-couch_epi-typespec
Fix couch_epi typespec for data provider
-rw-r--r-- | src/couch_epi/src/couch_epi.erl | 6 | ||||
-rw-r--r-- | src/couch_epi/src/couch_epi_plugin.erl | 5 |
2 files changed, 9 insertions, 2 deletions
diff --git a/src/couch_epi/src/couch_epi.erl b/src/couch_epi/src/couch_epi.erl index a9132998b..2ce4592d2 100644 --- a/src/couch_epi/src/couch_epi.erl +++ b/src/couch_epi/src/couch_epi.erl @@ -58,8 +58,12 @@ -type apply_opts() :: [apply_opt()]. +-type data_spec_opt() + :: {interval, pos_integer()}. + -type data_spec() - :: {module, module()} + :: {static_module, module()} + | {callback_module, module()} | {priv_file, FileName :: string()} | {file, FileName :: string()}. diff --git a/src/couch_epi/src/couch_epi_plugin.erl b/src/couch_epi/src/couch_epi_plugin.erl index 133a0d216..2cb1f3ebe 100644 --- a/src/couch_epi/src/couch_epi_plugin.erl +++ b/src/couch_epi/src/couch_epi_plugin.erl @@ -43,7 +43,10 @@ -callback providers() -> [{couch_epi:service_id(), module()}]. -callback services() -> [{couch_epi:service_id(), module()}]. -callback data_subscriptions() -> [{couch_epi:service_id(), couch_epi:key()}]. --callback data_providers() -> [{couch_epi:service_id(), couch_epi:data_spec()}]. +-callback data_providers() -> [ + {couch_epi:key(), couch_epi:data_spec()} + | {couch_epi:key(), couch_epi:data_spec(), [couch_epi:data_spec_opt()]} +]. -callback processes() -> [{couch_epi:plugin_id(), [supervisor:child_spec()]}]. -callback notify(Key :: term(), Old :: term(), New :: term()) -> ok. |