changes_loop/3 | |
fetch/1 | Equivalent to fetch(Db, []). |
fetch/2 | Collect Changes. |
parse_changes_options/1 | parse changes options and return a changes_args record. |
stream/2 | Equivalent to stream(Db, Client, []). |
stream/3 | Stream changes to a pid. |
changes_loop(Args::changes_args(), UserFun::function(), Params::{Url::string(), IbrowseOpts::list()}) -> ok
fetch(Db::db()) -> {ok, LastSeq::integer(), Rows::list()} | {error, LastSeq::integer(), Error::term()}
Equivalent to fetch(Db, []).
fetch(Db::db(), Options::changes_options1()) -> {ok, LastSeq::integer(), Rows::list()} | {error, LastSeq::integer(), Error::term()}
Collect Changes. Could be used to make a blocking call to a longpoll change feed
Db : a db record
ChangesOptions :: changes_options() [continuous | longpoll | normal | include_docs | {since, integer()} | {timeout, integer()} | heartbeat | {heartbeat, integer()} | {filter, string()} | {filter, string(), list({string(), string() | integer()}
longpoll | normal
: set the type of changes
feed to getinclude_docs
: if you want to include the doc in the line of
change{timeout, Timeout::integer()}
: timeoutheartbeat | {heartbeat, Heartbeat::integer()}
: set couchdb
to send a heartbeat to maintain connection open{filter, FilterName} | {filter, FilterName, Args::list({key,
value})
: set the filter to use with optional argumentsResut: {ok, LastSeq::integer(), Rows::list()}
or
{error, LastSeq, Error}
. LastSeq is the last sequence of changes.
parse_changes_options(Options::changes_options()) -> changes_args()
parse changes options and return a changes_args record
stream(Db::db(), Client::pid() | function()) -> {ok, StartRef::term(), ChangesPid::pid()} | {error, term()}
Equivalent to stream(Db, Client, []).
stream(Db::db(), Client::pid() | function(), Options::changes_options()) -> {ok, StartRef::term(), ChangesPid::pid()} | {ok, ChangesPid::pid()} | {error, term()}
Stream changes to a pid
Db : a db record
Client : pid or callback where to send changes events where events are The pid receive these events:
fun({done, LastSeq}) -> ok; fun({done, LastSeq}) -> ok; fun({done, LastSeq}) -> ok.
>ChangesOptions :: changes_options() [continuous | longpoll | normal | include_docs | {since, integer()} | {timeout, integer()} | heartbeat | {heartbeat, integer()} | {filter, string()} | {filter, string(), list({string(), string() | integer()}
continuous | longpoll | normal
: set the type of changes
feed to getinclude_doc
: if you want to include the doc in the line of
change{timeout, Timeout::integer()}
:: timeoutheartbeat | {heartbeat, Heartbeat::integer()}
: set couchdb
to send a heartbeat to maintain connection open{filter, FilterName} | {filter, FilterName, Args::list({key,
value})
: set the filter to use with optional argumentsReturn {ok, StartRef, ChangesPid} or {error, Error}. Ref can be used to disctint all changes from this pid. ChangesPid is the pid of the changes loop process. Can be used to monitor it or kill it when needed.
Generated by EDoc, Aug 31 2012, 10:02:31.