You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@couchdb.apache.org by kx...@apache.org on 2015/10/27 20:35:33 UTC

[2/2] couchdb-couch-epi git commit: Merge remote-tracking branch 'github/pr/15'

Merge remote-tracking branch 'github/pr/15'


Project: http://git-wip-us.apache.org/repos/asf/couchdb-couch-epi/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb-couch-epi/commit/807aa3f5
Tree: http://git-wip-us.apache.org/repos/asf/couchdb-couch-epi/tree/807aa3f5
Diff: http://git-wip-us.apache.org/repos/asf/couchdb-couch-epi/diff/807aa3f5

Branch: refs/heads/master
Commit: 807aa3f58e39f1273e732020c80d630d9177790c
Parents: 77dfaf4 86531ee
Author: Alexander Shorin <kx...@apache.org>
Authored: Tue Oct 27 22:31:11 2015 +0300
Committer: Alexander Shorin <kx...@apache.org>
Committed: Tue Oct 27 22:31:11 2015 +0300

----------------------------------------------------------------------
 README.md                       | 16 ++++++++
 src/couch_epi.erl               |  9 ++++-
 src/couch_epi_functions_gen.erl | 77 +++++++++++++++++++++++++++++++++++-
 3 files changed, 99 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb-couch-epi/blob/807aa3f5/README.md
----------------------------------------------------------------------
diff --cc README.md
index 7d5cc70,88390d0..5b5223f
--- a/README.md
+++ b/README.md
@@@ -96,11 -96,23 +96,27 @@@ There are multiple ways of doing the ap
  Notes:
  
    - `concurrent` is incompatible with `pipe`
 +  - if there are multiple plugins providing same service they will be called in the order
 +    they listed in application:get_env(couch_epi, plugins)
 +  - if the same plugin provides multiple implementations of the same service
 +    the order is as defined in providers callback
  
+ ## decide functionality
+ 
+ There are cases when we want to call configured providers until any of them
+ would make a decission. We also would want to be able to find out if any
+ decision has been made so we could call default handler. In order to be able
+ to do so there is couch_epi:decide/5. Every service which uses this feature
+ would get either:
+ 
+   - no_decision
+   - {decided, Decision :: term()}
+ 
+ The provider module should return one of the above results. The current logic is
+ to call all configured providers in order of their definition until we get
+ `{decided, term()}`. If none of the providers would return this term we would
+ return `no_decision`.
+ 
  # couch_epi_plugin behaviour
  
  The module implementing behaviour need to export following functions:

http://git-wip-us.apache.org/repos/asf/couchdb-couch-epi/blob/807aa3f5/src/couch_epi.erl
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/couchdb-couch-epi/blob/807aa3f5/src/couch_epi_functions_gen.erl
----------------------------------------------------------------------