Copyright | (C) 2018 Yorick Laupa |
---|---|
License | (see the file LICENSE) |
Maintainer | Yorick Laupa <yo.eight@gmail.com> |
Stability | experimental |
Portability | non-portable |
Safe Haskell | None |
Language | Haskell2010 |
Synopsis
- data ReadError t where
- StreamDeleted :: StreamName -> ReadError EventNumber
- ReadError :: Maybe Text -> ReadError t
- AccessDenied :: StreamId t -> ReadError t
- NoStream :: ReadError EventNumber
- data Fetch t
- = FetchError !(ReadError t)
- | Fetch !(Slice t)
- newtype ReadResultHandler = ReadResultHandler {
- runReadResultHandler :: forall t. StreamId t -> BatchResult t -> Fetch t
- readThroughForward :: Connection -> StreamId t -> ResolveLink -> t -> Maybe Int32 -> Maybe Credentials -> Stream (Of ResolvedEvent) (ExceptT (ReadError t) IO) ()
- readThroughBackward :: Connection -> StreamId t -> ResolveLink -> t -> Maybe Int32 -> Maybe Credentials -> Stream (Of ResolvedEvent) (ExceptT (ReadError t) IO) ()
- throwOnError :: (Show t, Typeable t) => Stream (Of a) (ExceptT (ReadError t) IO) () -> Stream (Of a) IO ()
- defaultReadResultHandler :: ReadResultHandler
- onRegularStream :: (ReadResult EventNumber (Slice EventNumber) -> Fetch EventNumber) -> ReadResultHandler
- readThrough :: Connection -> ReadResultHandler -> ReadDirection -> StreamId t -> ResolveLink -> t -> Maybe Int32 -> Maybe Credentials -> Stream (Of ResolvedEvent) (ExceptT (ReadError t) IO) ()
Documentation
data ReadError t where Source #
StreamDeleted :: StreamName -> ReadError EventNumber | |
ReadError :: Maybe Text -> ReadError t | |
AccessDenied :: StreamId t -> ReadError t | |
NoStream :: ReadError EventNumber |
Instances
Show (ReadError t) Source # | |
(Show t, Typeable t) => Exception (ReadError t) Source # | |
Defined in Database.EventStore.Streaming toException :: ReadError t -> SomeException # fromException :: SomeException -> Maybe (ReadError t) # displayException :: ReadError t -> String # |
newtype ReadResultHandler Source #
ReadResultHandler | |
|
readThroughForward :: Connection -> StreamId t -> ResolveLink -> t -> Maybe Int32 -> Maybe Credentials -> Stream (Of ResolvedEvent) (ExceptT (ReadError t) IO) () Source #
Returns an iterator able to consume a stream entirely. When reading forward, the iterator ends when the last stream's event is reached.
readThroughBackward :: Connection -> StreamId t -> ResolveLink -> t -> Maybe Int32 -> Maybe Credentials -> Stream (Of ResolvedEvent) (ExceptT (ReadError t) IO) () Source #
Returns an iterator able to consume a stream entirely. When reading backward, the iterator ends when the first stream's event is reached.
throwOnError :: (Show t, Typeable t) => Stream (Of a) (ExceptT (ReadError t) IO) () -> Stream (Of a) IO () Source #
onRegularStream :: (ReadResult EventNumber (Slice EventNumber) -> Fetch EventNumber) -> ReadResultHandler Source #
readThrough :: Connection -> ReadResultHandler -> ReadDirection -> StreamId t -> ResolveLink -> t -> Maybe Int32 -> Maybe Credentials -> Stream (Of ResolvedEvent) (ExceptT (ReadError t) IO) () Source #
Returns an iterator able to consume a stream entirely.