Skip to content

Commit

Permalink
added operations interface
Browse files Browse the repository at this point in the history
  • Loading branch information
Michael Liao committed Nov 16, 2018
1 parent c476d6a commit 7d73fbe
Showing 1 changed file with 41 additions and 1 deletion.
42 changes: 41 additions & 1 deletion src/Equinox.Cosmos/Cosmos.fs
Original file line number Diff line number Diff line change
Expand Up @@ -942,4 +942,44 @@ type EqxConnector
/// Yields a DocDbConnection configured per the specified strategy
member __.Connect(name, discovery : Discovery) : Async<EqxConnection> = async {
let! conn = connect(name, discovery)
return EqxConnection(conn, ?readRetryPolicy=readRetryPolicy, ?writeRetryPolicy=writeRetryPolicy) }
return EqxConnection(conn, ?readRetryPolicy=readRetryPolicy, ?writeRetryPolicy=writeRetryPolicy) }


// TODO add all these operations with the exact same API
///// Operations on Equinox.
//[<RequireQualifiedAccess>]
//module Equinox =

// /// Returns an async sequence of events in the stream starting at the specified sequence number,
// /// reading in batches of the specified size.
// /// Returns an empty sequence if the stream is empty or if the sequence number is larger than the largest
// /// sequence number in the stream.
// let getAll (conn:EquinoxConnection, sid:StreamId, sn:SN, batchSize:int) AsyncSeq<EquinoxEvent[]>

// /// Returns an async array of events in the stream starting at the specified sequence number,
// /// number of events to read is specified by batchSize
// /// Returns an empty sequence if the stream is empty or if the sequence number is larger than the largest
// /// sequence number in the stream.
// val get : conn:EquinoxConnection -> sid:StreamId -> sn:SN -> batchSize:int -> Async<EquinoxEvent[]>

// /// Appends a batch of events to a stream at the specified expected sequence number.
// /// If the specified expected sequence number does not match the stream, the events are not appended
// /// and a failure is returned.
// val append : conn:EquinoxConnection -> sid:StreamId -> sn:SN -> eds:EventData[] -> Async<Result<SN, AppendError>>

// val appendAtEnd : conn:EquinoxConnection -> sid:StreamId -> eds:EventData[] -> Async<Result<SN, AppendError>>

// /// Returns an async sequence of events in the stream backwards starting from the specified sequence number,
// /// reading in batches of the specified size.
// /// Returns an empty sequence if the stream is empty or if the sequence number is smaller than the smallest
// /// sequence number in the stream.
// val getAllBackwards : conn:EquinoxConnection -> sid:StreamId -> sn:SN -> batchSize:int -> AsyncSeq<EquinoxEvent[]>

// /// Returns an async array of events in the stream backwards starting from the specified sequence number,
// /// number of events to read is specified by batchSize
// /// Returns an empty sequence if the stream is empty or if the sequence number is smaller than the smallest
// /// sequence number in the stream.
// val getBackwards : conn:EquinoxConnection -> sid:StreamId -> sn:SN -> batchSize:int -> Async<EquinoxEvent[]>

// /// Returns last sequence number of the stream using query, returns 0 if stream doesn't exist.
// val getLastSn : conn:EquinoxConnection -> sid:StreamId -> Async<SN option>

0 comments on commit 7d73fbe

Please sign in to comment.