Collection.Change_feedmodule Mode : sig ... endPull-model latest-version change feed operations.
module Start_from : sig ... endmodule Scope : sig ... endtype page = {rid : string;documents : (string * Document.list_result_meta_data option) list;count : int;continuation : string;has_more_pages : bool;Presence of x-ms-continuation; Azure may omit it for change feed. Continue with Continuation continuation until 304, as drain does.
session_token : string option;}val read :
?mode:Mode.t ->
?start_from:Start_from.t ->
?scope:Scope.t ->
?max_item_count:int ->
?session_token:string ->
?timeout:float ->
string ->
string ->
(int * Cosmos_eio.Database_intf.Response_headers.t * page option,
Database_intf.cosmos_error)
Stdlib.result
Database_intf.ioread db coll reads one page. Ok (304, _, None) means the feed is idle, not that the request failed. Persist page.continuation and resume with Start_from.Continuation. A supplied timeout applies independently to each request attempt; exhausted 429 retries are reported as Timeout_error.
val is_partition_split : Database_intf.cosmos_error -> boolval drain :
?mode:Mode.t ->
?start_from:Start_from.t ->
?scope:Scope.t ->
?max_item_count:int ->
?max_pages:int ->
?timeout:float ->
string ->
string ->
(drain_result, Database_intf.cosmos_error) Stdlib.result Database_intf.iotype 'acc fold_error = 'acc Cosmos.Databases_core.fold_error = | Read_error of {error : Database_intf.cosmos_error;acc : 'acc;checkpoint : string;}| Handler_error of {}Error returned by fold. Read_error means the feed read failed with error; Handler_error means the page callback returned Error message. Both carry the accumulator and checkpoint of the last successfully processed page, so the fold can be resumed from that checkpoint. checkpoint is empty when no page had been processed and no resume checkpoint was supplied.
val fold :
?mode:Mode.t ->
?start_from:Start_from.t ->
?scope:Scope.t ->
?max_item_count:int ->
?poll_interval:float ->
?max_polls:int ->
?timeout:float ->
string ->
string ->
init:'acc ->
f:('acc -> page -> ('acc, string) Stdlib.result Database_intf.io) ->
('acc * string, 'acc fold_error) Stdlib.result Database_intf.io