Copyright | (C) 2014 Yorick Laupa |
---|---|
License | (see the file LICENSE) |
Maintainer | Yorick Laupa <yo.eight@gmail.com> |
Stability | provisional |
Portability | non-portable |
Safe Haskell | None |
Language | Haskell2010 |
- data Event
- data EventData
- data Connection
- data Credentials
- data ExpectedVersion
- = Any
- | NoStream
- | EmptyStream
- type HostName = String
- type Port = Int
- data Settings = Settings {}
- data Subscription = Subscription {
- subId :: !UUID
- subStream :: !Text
- subResolveLinkTos :: !Bool
- subEventChan :: !(TChan (Either DropReason ResolvedEventBuf))
- subLastCommitPos :: !Int64
- subLastEventNumber :: !(Maybe Int32)
- subUnsubscribe :: IO ()
- credentials :: ByteString -> ByteString -> Credentials
- data AllEventsSlice = AllEventsSlice {}
- newtype DeleteResult = DeleteResult {}
- data WriteResult = WriteResult {}
- data ReadResult = ReadResult {}
- data RecordedEvent = RecordedEvent {}
- data StreamEventsSlice = StreamEventsSlice {}
- data Position = Position {
- positionCommit :: !Int64
- positionPrepare :: !Int64
- data ReadDirection
- data ReadAllResult
- data ReadEventResult
- data ResolvedEvent = ResolvedEvent {}
- data ReadStreamResult
- data DropReason
- eventResolved :: ResolvedEvent -> Bool
- resolvedEventOriginal :: ResolvedEvent -> Maybe RecordedEvent
- resolvedEventOriginalStreamId :: ResolvedEvent -> Maybe Text
- createEvent :: Text -> EventData -> Event
- withJson :: Value -> EventData
- withJsonAndMetadata :: Value -> Value -> EventData
- defaultSettings :: Settings
- connect :: Settings -> HostName -> Port -> IO Connection
- deleteStream :: Connection -> Text -> ExpectedVersion -> Maybe Bool -> IO (Async DeleteResult)
- readEvent :: Connection -> Text -> Int32 -> Bool -> IO (Async ReadResult)
- readAllEventsBackward :: Connection -> Int64 -> Int64 -> Int32 -> Bool -> IO (Async AllEventsSlice)
- readAllEventsForward :: Connection -> Int64 -> Int64 -> Int32 -> Bool -> IO (Async AllEventsSlice)
- readStreamEventsBackward :: Connection -> Text -> Int32 -> Int32 -> Bool -> IO (Async StreamEventsSlice)
- readStreamEventsForward :: Connection -> Text -> Int32 -> Int32 -> Bool -> IO (Async StreamEventsSlice)
- sendEvent :: Connection -> Text -> ExpectedVersion -> Event -> IO (Async WriteResult)
- sendEvents :: Connection -> Text -> ExpectedVersion -> [Event] -> IO (Async WriteResult)
- shutdown :: Connection -> IO ()
- transactionStart :: Connection -> Text -> ExpectedVersion -> IO (Async Transaction)
- subscribe :: Connection -> Text -> Bool -> IO (Async Subscription)
- data Transaction
- transactionCommit :: Transaction -> IO (Async WriteResult)
- transactionRollback :: Transaction -> IO ()
- transactionSendEvents :: Transaction -> [Event] -> IO (Async ())
- module Control.Concurrent.Async
Documentation
data Connection Source
data ExpectedVersion Source
Any | Says that you should not conflict with anything |
NoStream | Stream should not exist when doing your write |
EmptyStream | Stream should exist but be empty when doing the write |
Global ConnectionManager
settings
data Subscription Source
Subscription | |
|
credentials :: ByteString -> ByteString -> Credentials Source
Result
data WriteResult Source
data RecordedEvent Source
data ReadAllResult Source
data ReadEventResult Source
data ReadStreamResult Source
data DropReason Source
eventResolved :: ResolvedEvent -> Bool Source
Event
createEvent :: Text -> EventData -> Event Source
withJsonAndMetadata :: Value -> Value -> EventData Source
Connection manager
connect :: Settings -> HostName -> Port -> IO Connection Source
Creates a new connection to a single node. It maintains a full duplex
connection to the EventStore. An EventStore Connection
operates quite
differently than say a SQL connection. Normally when you use a SQL
connection you want to keep the connection open for a much longer of time
than when you use a SQL connection.
Another difference is that with the EventStore Connection
all operation
are handled in a full async manner (even if you call the synchronous
behaviors). Many threads can use an EvenStore connection at the same time
or a single thread can make many asynchronous requests. To get the most
performance out of the connection it is generally recommend to use it in
this way
:: Connection | |
-> Text | |
-> ExpectedVersion | |
-> Maybe Bool | Hard delete |
-> IO (Async DeleteResult) |
readEvent :: Connection -> Text -> Int32 -> Bool -> IO (Async ReadResult) Source
readAllEventsBackward :: Connection -> Int64 -> Int64 -> Int32 -> Bool -> IO (Async AllEventsSlice) Source
readAllEventsForward :: Connection -> Int64 -> Int64 -> Int32 -> Bool -> IO (Async AllEventsSlice) Source
readStreamEventsBackward :: Connection -> Text -> Int32 -> Int32 -> Bool -> IO (Async StreamEventsSlice) Source
readStreamEventsForward :: Connection -> Text -> Int32 -> Int32 -> Bool -> IO (Async StreamEventsSlice) Source
:: Connection | |
-> Text | Stream |
-> ExpectedVersion | |
-> Event | |
-> IO (Async WriteResult) |
:: Connection | |
-> Text | Stream |
-> ExpectedVersion | |
-> [Event] | |
-> IO (Async WriteResult) |
shutdown :: Connection -> IO () Source
transactionStart :: Connection -> Text -> ExpectedVersion -> IO (Async Transaction) Source
subscribe :: Connection -> Text -> Bool -> IO (Async Subscription) Source
Transaction
data Transaction Source
transactionCommit :: Transaction -> IO (Async WriteResult) Source
transactionRollback :: Transaction -> IO () Source
transactionSendEvents :: Transaction -> [Event] -> IO (Async ()) Source
Re-export
module Control.Concurrent.Async