eventstore-1.4.2: EventStore TCP Client
Copyright(C) 2019 Yorick Laupa
License(see the file LICENSE)
MaintainerYorick Laupa <yo.eight@gmail.com>
Stabilityprovisional
Portabilitynon-portable
Safe HaskellNone
LanguageHaskell2010

Database.EventStore

Description

 
Synopsis

Connection

data Connection Source #

Represents a connection to a single EventStore node.

data ConnectionType Source #

Gathers every connection type handled by the client.

Constructors

Static String Int

HostName and Port.

Cluster ClusterSettings 
Dns ByteString (Maybe DnsServer) Int

Domain name, optional DNS server and port.

data Credentials Source #

Holds login and password information.

data Settings Source #

Global Connection settings

Constructors

Settings 

Fields

data Retry Source #

Represents reconnection strategy.

atMost :: Int -> Retry Source #

Indicates how many times we should try to reconnect to the server. A value less than or equal to 0 means no retry.

keepRetrying :: Retry Source #

Indicates we should try to reconnect to the server until the end of the Universe.

credentials Source #

Arguments

:: ByteString

Login

-> ByteString

Password

-> Credentials 

Creates a Credentials given a login and a password.

defaultSSLSettings :: TLSSettings -> Settings Source #

Default SSL settings based on defaultSettings.

connect :: Settings -> ConnectionType -> 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 an EventStore 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 operations 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 recommended to use it in this way.

shutdown :: Connection -> IO () Source #

Asynchronously closes the Connection.

waitTillClosed :: Connection -> IO () Source #

Waits the Connection to be closed.

Cluster Connection

data ClusterSettings Source #

Contains settings related to a connection to a cluster.

Constructors

ClusterSettings 

Fields

data DnsServer Source #

Tells how the DNS server should be contacted.

data GossipSeed Source #

Represents a source of cluster gossip.

Instances

Instances details
Show GossipSeed Source # 
Instance details

Defined in Database.EventStore.Internal.Discovery

gossipSeedWithHeader :: String -> Int -> String -> GossipSeed Source #

Creates a GossipSeed with a specific HTTP header.

gossipSeedHost :: GossipSeed -> String Source #

Returns GossipSeed host IP address.

gossipSeedHeader :: GossipSeed -> String Source #

The host header to be sent when requesting gossip.

gossipSeedClusterSettings :: NonEmpty GossipSeed -> ClusterSettings Source #

Configures a ClusterSettings for connecting to a cluster using gossip seeds. clusterDns = "" clusterMaxDiscoverAttempts = 10 clusterExternalGossipPort = 0 clusterGossipTimeout = 1s

dnsClusterSettings :: ByteString -> ClusterSettings Source #

Configures a ClusterSettings for connecting to a cluster using DNS discovery. clusterMaxDiscoverAttempts = 10 clusterExternalGossipPort = 0 clusterGossipSeeds = Nothing clusterGossipTimeout = 1s

Event

data Event Source #

Contains event information like its type and data. Only used for write queries.

Instances

Instances details
Eq Event Source # 
Instance details

Defined in Database.EventStore.Internal.Types

Methods

(==) :: Event -> Event -> Bool #

(/=) :: Event -> Event -> Bool #

Show Event Source # 
Instance details

Defined in Database.EventStore.Internal.Types

Methods

showsPrec :: Int -> Event -> ShowS #

show :: Event -> String #

showList :: [Event] -> ShowS #

data EventData Source #

Holds event data.

Instances

Instances details
Eq EventData Source # 
Instance details

Defined in Database.EventStore.Internal.Types

Show EventData Source # 
Instance details

Defined in Database.EventStore.Internal.Types

data EventType Source #

Constants for System event types.

Constructors

StreamDeletedType

Event type for stream deleted.

StatsCollectionType

Event type for statistics.

LinkToType

Event type for linkTo.

StreamMetadataType

Event type for stream metadata.

SettingsType

Event type for the system settings.

UserDefined Text

Event defined by the user.

Instances

Instances details
Eq EventType Source # 
Instance details

Defined in Database.EventStore.Internal.Types

Show EventType Source # 
Instance details

Defined in Database.EventStore.Internal.Types

IsString EventType Source # 
Instance details

Defined in Database.EventStore.Internal.Types

createEvent Source #

Arguments

:: EventType

Event type

-> Maybe UUID

Event ID, generated if Nothing

-> EventData

Event data

-> Event 

Create an Event meant to be persisted.

withJson :: ToJSON a => a -> EventData Source #

Creates an event using JSON format

withJsonAndMetadata :: (ToJSON a, ToJSON b) => a -> b -> EventData Source #

Creates an event with metadata using JSON format.

withBinary :: ByteString -> EventData Source #

Creates an event using a binary format.

withBinaryAndMetadata :: ByteString -> ByteString -> EventData Source #

Creates an event with metadata using binary format.

Event number

streamStart :: EventNumber Source #

The first event in a stream.

streamEnd :: EventNumber Source #

The last event in the stream.

eventNumber :: Natural -> EventNumber Source #

the Nth event of a stream.

rawEventNumber :: Int64 -> EventNumber Source #

Returns a 'EventNumber from a raw Int64.

Read Operations

data StreamMetadataResult Source #

Represents stream metadata as a series of properties for system data and a StreamMetadata object for user metadata.

Constructors

StreamMetadataResult 

Fields

NotFoundStreamMetadataResult

When the stream is either not found or 'no stream'.

Fields

DeletedStreamMetadataResult

When the stream is soft-deleted.

Fields

type family BatchResult t where ... Source #

When batch-reading a stream, this type-level function maps the result you will have whether you read a regular stream or $all stream. When reading a regular stream, some read-error can occur like the stream got deleted. However read-error cannot occur when reading $all stream (because $all cannot get deleted).

data ResolveLink Source #

Determines whether any link event encountered in the stream will be resolved. See the discussion for more information: https://eventstore.com/docs/dotnet-api/reading-events/index.html#resolvedevent

Constructors

ResolveLink 
NoResolveLink 

Instances

readEvent :: Connection -> StreamName -> EventNumber -> ResolveLink -> Maybe Credentials -> IO (Async (ReadResult EventNumber ReadEvent)) Source #

Reads a single event from given stream.

readEventsBackward Source #

Arguments

:: Connection 
-> StreamId t 
-> t 
-> Int32

Batch size

-> ResolveLink 
-> Maybe Credentials 
-> IO (Async (BatchResult t)) 

Reads events from a stream backward.

readEventsForward Source #

Arguments

:: Connection 
-> StreamId t 
-> t 
-> Int32

Batch size

-> ResolveLink 
-> Maybe Credentials 
-> IO (Async (BatchResult t)) 

Reads events from a stream forward.

getStreamMetadata :: Connection -> StreamName -> Maybe Credentials -> IO (Async StreamMetadataResult) Source #

Asynchronously gets the metadata of a stream.

Write Operations

data StreamACL Source #

Represents an access control list for a stream.

Constructors

StreamACL 

Fields

data StreamMetadata Source #

Represents stream metadata with strongly typed properties for system values and a dictionary-like interface for custom values.

Constructors

StreamMetadata 

Fields

getCustomPropertyValue :: StreamMetadata -> Key -> Maybe Value Source #

Gets a custom property value from metadata.

getCustomProperty :: FromJSON a => StreamMetadata -> Key -> Maybe a Source #

Get a custom property value from metadata.

emptyStreamACL :: StreamACL Source #

StreamACL with no role or users whatsoever.

deleteStream Source #

Arguments

:: Connection 
-> StreamName 
-> ExpectedVersion 
-> Maybe Bool

Hard delete

-> Maybe Credentials 
-> IO (Async DeleteResult) 

Deletes given stream.

sendEvents :: Connection -> StreamName -> ExpectedVersion -> [Event] -> Maybe Credentials -> IO (Async WriteResult) Source #

Sends a list of Event to given stream.

setStreamMetadata :: Connection -> StreamName -> ExpectedVersion -> StreamMetadata -> Maybe Credentials -> IO (Async WriteResult) Source #

Asynchronously sets the metadata for a stream.

Builder

type Builder a = Endo a Source #

Allows to build a structure using Monoid functions.

Stream ACL Builder

setReadRoles :: [Text] -> StreamACLBuilder Source #

Sets role names with read permission for the stream.

setReadRole :: Text -> StreamACLBuilder Source #

Sets a single role name with read permission for the stream.

setWriteRoles :: [Text] -> StreamACLBuilder Source #

Sets role names with write permission for the stream.

setWriteRole :: Text -> StreamACLBuilder Source #

Sets a single role name with write permission for the stream.

setDeleteRoles :: [Text] -> StreamACLBuilder Source #

Sets role names with delete permission for the stream.

setDeleteRole :: Text -> StreamACLBuilder Source #

Sets a single role name with delete permission for the stream.

setMetaReadRoles :: [Text] -> StreamACLBuilder Source #

Sets role names with metadata read permission for the stream.

setMetaReadRole :: Text -> StreamACLBuilder Source #

Sets a single role name with metadata read permission for the stream.

setMetaWriteRoles :: [Text] -> StreamACLBuilder Source #

Sets role names with metadata write permission for the stream.

setMetaWriteRole :: Text -> StreamACLBuilder Source #

Sets a single role name with metadata write permission for the stream.

Stream Metadata Builder

setMaxCount :: Int32 -> StreamMetadataBuilder Source #

Sets the maximum number of events allowed in the stream.

setMaxAge :: TimeSpan -> StreamMetadataBuilder Source #

Sets the maximum age of events allowed in the stream.

setTruncateBefore :: Int32 -> StreamMetadataBuilder Source #

Sets the event number from which previous events can be scavenged.

setCacheControl :: TimeSpan -> StreamMetadataBuilder Source #

Sets the amount of time for which the stream head is cachable.

setACL :: StreamACL -> StreamMetadataBuilder Source #

Overwrites any previous StreamACL by the given one in a StreamMetadataBuilder.

setCustomProperty :: ToJSON a => Key -> a -> StreamMetadataBuilder Source #

Sets a custom metadata property.

Transaction

data Transaction Source #

Represents a multi-request transaction with the EventStore.

startTransaction Source #

Arguments

:: Connection 
-> StreamName

Stream name

-> ExpectedVersion 
-> Maybe Credentials 
-> IO (Async Transaction) 

Starts a transaction on given stream.

transactionCommit :: Transaction -> Maybe Credentials -> IO (Async WriteResult) Source #

Asynchronously commits this transaction.

transactionRollback :: Transaction -> IO () Source #

There isn't such of thing in EventStore parlance. Basically, if you want to rollback, you just have to not transactionCommit a Transaction.

transactionWrite :: Transaction -> [Event] -> Maybe Credentials -> IO (Async ()) Source #

Asynchronously writes to a transaction in the EventStore.

Subscription

data SubDropReason Source #

Indicates why a subscription has been dropped.

Constructors

SubUnsubscribed

Subscription connection has been closed by the user.

SubAccessDenied

The current user is not allowed to operate on the supplied stream.

SubNotFound

Given stream name doesn't exist.

SubPersistDeleted

Given stream is deleted.

SubAborted

Occurs when the user shutdown the connection from the server or if the connection to the server is no longer possible.

SubNotAuthenticated (Maybe Text) 
SubServerError (Maybe Text)

Unexpected error from the server.

SubNotHandled !NotHandledReason !(Maybe MasterInfo) 
SubClientError !Text 
SubSubscriberMaxCountReached 

data SubDetails Source #

Subscription runtime details. Not useful for the user but at least it makes Haddock documentation generation less ugly.

unsubscribe :: Subscription s => s -> IO () Source #

Asynchronously unsubscribe from a subscription.

nextSubEvent :: Subscription s => s -> IO SubAction Source #

Asks for the next subcription event. If that function is called after a SubDropped event, expect it to hang indefinitely.

streamSubEvents :: Subscription s => s -> Stream (Of SubAction) IO () Source #

Streams a subscription events. The stream will end when hitting Dropped event but will still emit it.

streamSubResolvedEvents :: Subscription s => s -> Stream (Of ResolvedEvent) IO () Source #

Like streamSubEvent but will only emit ResolvedEvent.

Volatile Subscription

data RegularSubscription t Source #

Also referred as volatile subscription. For example, if a stream has 100 events in it when a subscriber connects, the subscriber can expect to see event number 101 onwards until the time the subscription is closed or dropped.

Catch-up Subscription

data CatchupSubscription t Source #

This kind of subscription specifies a starting point, in the form of an event number or transaction file position. The given function will be called for events from the starting point until the end of the stream, and then for subsequently written events.

For example, if a starting point of 50 is specified when a stream has 100 events in it, the subscriber can expect to see events 51 through 100, and then any events subsequently written until such time as the subscription is dropped or closed.

subscribeFrom Source #

Arguments

:: Connection 
-> StreamId t 
-> ResolveLink 
-> Maybe t 
-> Maybe Int32

Batch size

-> Maybe Credentials 
-> IO (CatchupSubscription t) 

Subscribes to a stream. If last checkpoint is defined, this will readStreamEventsForward from that event number, otherwise from the beginning. Once last stream event reached up, a subscription request will be sent using subscribe.

Persistent Subscription

data PersistentSubscription Source #

The server remembers the state of the subscription. This allows for many different modes of operations compared to a regular or catchup subscription where the client holds the subscription state. (Need EventStore >= v3.1.0).

data PersistentSubscriptionSettings Source #

Gathers every persistent subscription property.

Constructors

PersistentSubscriptionSettings 

Fields

data SystemConsumerStrategy Source #

System supported consumer strategies for use with persistent subscriptions.

Constructors

DispatchToSingle

Distributes events to a single client until the bufferSize is reached. After which the next client is selected in a round robin style, and the process is repeated.

RoundRobin

Distributes events to all clients evenly. If the client buffer-size is reached the client is ignored until events are acknowledged/not acknowledged.

Pinned

For use with an indexing projection such as the system $by_category projection. Event Store inspects event for its source stream id, hashing the id to one of 1024 buckets assigned to individual clients. When a client disconnects it's buckets are assigned to other clients. When a client connects, it is assigned some of the existing buckets. This naively attempts to maintain a balanced workload. The main aim of this strategy is to decrease the likelihood of concurrency and ordering issues while maintaining load balancing. This is not a guarantee, and you should handle the usual ordering and concurrency issues.

data PersistActionException Source #

Enumerates all persistent action exceptions.

Constructors

PersistActionFail

The action failed.

PersistActionAlreadyExist

Happens when creating a persistent subscription on a stream with a group name already taken.

PersistActionDoesNotExist

An operation tried to do something on a persistent subscription or a stream that don't exist.

PersistActionAccessDenied

The current user is not allowed to operate on the supplied stream or persistent subscription.

PersistActionAborted

That action has been aborted because the user shutdown the connection to the server or the connection to the server is no longer possible.

acknowledge :: PersistentSubscription -> ResolvedEvent -> IO () Source #

Acknowledges that ResolvedEvent has been successfully processed.

acknowledgeEvents :: PersistentSubscription -> [ResolvedEvent] -> IO () Source #

Acknowledges those ResolvedEvents have been successfully processed.

failed :: PersistentSubscription -> ResolvedEvent -> NakAction -> Maybe Text -> IO () Source #

Mark a message that has failed processing. The server will take action based upon the action parameter.

eventsFailed :: PersistentSubscription -> [ResolvedEvent] -> NakAction -> Maybe Text -> IO () Source #

Mark messages that have failed processing. The server will take action based upon the action parameter.

notifyEventsProcessed :: PersistentSubscription -> [UUID] -> IO () Source #

Acknowledges those event ids have been successfully processed.

notifyEventsFailed :: PersistentSubscription -> NakAction -> Maybe Text -> [UUID] -> IO () Source #

Acknowledges those event ids have failed to be processed successfully.

defaultPersistentSubscriptionSettings :: PersistentSubscriptionSettings Source #

System default persistent subscription settings.

createPersistentSubscription :: Connection -> Text -> StreamName -> PersistentSubscriptionSettings -> Maybe Credentials -> IO (Async (Maybe PersistActionException)) Source #

Asynchronously create a persistent subscription group on a stream.

updatePersistentSubscription :: Connection -> Text -> StreamName -> PersistentSubscriptionSettings -> Maybe Credentials -> IO (Async (Maybe PersistActionException)) Source #

Asynchronously update a persistent subscription group on a stream.

deletePersistentSubscription :: Connection -> Text -> StreamName -> Maybe Credentials -> IO (Async (Maybe PersistActionException)) Source #

Asynchronously delete a persistent subscription group on a stream.

connectToPersistentSubscription :: Connection -> Text -> StreamName -> Int32 -> Maybe Credentials -> IO PersistentSubscription Source #

Asynchronously connect to a persistent subscription given a group on a stream.

Results

data Slice t Source #

Gathers common slice operations.

Constructors

SliceEndOfStream 
Slice ![ResolvedEvent] !(Maybe t) 

Instances

Instances details
Functor Slice Source # 
Instance details

Defined in Database.EventStore.Internal.Operation.Read.Common

Methods

fmap :: (a -> b) -> Slice a -> Slice b #

(<$) :: a -> Slice b -> Slice a #

Show t => Show (Slice t) Source # 
Instance details

Defined in Database.EventStore.Internal.Operation.Read.Common

Methods

showsPrec :: Int -> Slice t -> ShowS #

show :: Slice t -> String #

showList :: [Slice t] -> ShowS #

sliceEvents :: Slice t -> [ResolvedEvent] Source #

Gets slice's ResolvedEventss.

sliceEOS :: Slice t -> Bool Source #

If the slice has reached the end of the stream.

sliceNext :: Slice t -> Maybe t Source #

Gets the next location of this slice.

emptySlice :: Slice t Source #

Empty slice.

type AllSlice = Slice Position Source #

Represents a slice of the $all stream.

newtype DeleteResult Source #

Returned after deleting a stream. Position of the write.

Constructors

DeleteResult Position 

data WriteResult Source #

Returned after writing to a stream.

Constructors

WriteResult 

Fields

data ReadResult t a where Source #

Enumeration detailing the possible outcomes of reading a stream.

Instances

Instances details
Functor (ReadResult t) Source # 
Instance details

Defined in Database.EventStore.Internal.Operation.Read.Common

Methods

fmap :: (a -> b) -> ReadResult t a -> ReadResult t b #

(<$) :: a -> ReadResult t b -> ReadResult t a #

Foldable (ReadResult t) Source # 
Instance details

Defined in Database.EventStore.Internal.Operation.Read.Common

Methods

fold :: Monoid m => ReadResult t m -> m #

foldMap :: Monoid m => (a -> m) -> ReadResult t a -> m #

foldMap' :: Monoid m => (a -> m) -> ReadResult t a -> m #

foldr :: (a -> b -> b) -> b -> ReadResult t a -> b #

foldr' :: (a -> b -> b) -> b -> ReadResult t a -> b #

foldl :: (b -> a -> b) -> b -> ReadResult t a -> b #

foldl' :: (b -> a -> b) -> b -> ReadResult t a -> b #

foldr1 :: (a -> a -> a) -> ReadResult t a -> a #

foldl1 :: (a -> a -> a) -> ReadResult t a -> a #

toList :: ReadResult t a -> [a] #

null :: ReadResult t a -> Bool #

length :: ReadResult t a -> Int #

elem :: Eq a => a -> ReadResult t a -> Bool #

maximum :: Ord a => ReadResult t a -> a #

minimum :: Ord a => ReadResult t a -> a #

sum :: Num a => ReadResult t a -> a #

product :: Num a => ReadResult t a -> a #

Traversable (ReadResult t) Source # 
Instance details

Defined in Database.EventStore.Internal.Operation.Read.Common

Methods

traverse :: Applicative f => (a -> f b) -> ReadResult t a -> f (ReadResult t b) #

sequenceA :: Applicative f => ReadResult t (f a) -> f (ReadResult t a) #

mapM :: Monad m => (a -> m b) -> ReadResult t a -> m (ReadResult t b) #

sequence :: Monad m => ReadResult t (m a) -> m (ReadResult t a) #

Eq a => Eq (ReadResult t a) Source # 
Instance details

Defined in Database.EventStore.Internal.Operation.Read.Common

Methods

(==) :: ReadResult t a -> ReadResult t a -> Bool #

(/=) :: ReadResult t a -> ReadResult t a -> Bool #

Show a => Show (ReadResult t a) Source # 
Instance details

Defined in Database.EventStore.Internal.Operation.Read.Common

Methods

showsPrec :: Int -> ReadResult t a -> ShowS #

show :: ReadResult t a -> String #

showList :: [ReadResult t a] -> ShowS #

data RecordedEvent Source #

Represents a previously written event.

Constructors

RecordedEvent 

Fields

Instances

Instances details
Show RecordedEvent Source # 
Instance details

Defined in Database.EventStore.Internal.Types

data ReadEvent Source #

Represents the result of looking up a specific event number from a stream.

Instances

Instances details
Show ReadEvent Source # 
Instance details

Defined in Database.EventStore.Internal.Operation.ReadEvent

type StreamSlice = Slice EventNumber Source #

Regular stream slice.

data Position Source #

A structure referring to a potential logical record position in the EventStore transaction file.

Constructors

Position 

Fields

data ReadDirection Source #

Represents the direction of read operation (both from $all an usual streams).

Constructors

Forward

From beginning to end

Backward

From end to beginning

data ResolvedEvent Source #

A structure representing a single event or an resolved link event.

Constructors

ResolvedEvent 

Fields

Instances

Instances details
Show ResolvedEvent Source # 
Instance details

Defined in Database.EventStore.Internal.Types

data OperationError Source #

Operation exception that can occurs on an operation response.

Constructors

WrongExpectedVersion !Text !ExpectedVersion

Stream and Expected Version

StreamDeleted !StreamName

Stream

InvalidTransaction 
forall t. AccessDenied !(StreamId t)

Stream

InvalidServerResponse !Command !Command

Expected, Found

ProtobufDecodingError !String 
ServerError !(Maybe Text)

Reason

InvalidOperation !Text 
StreamNotFound !StreamName 
NotAuthenticatedOp

Invalid operation state. If happens, it's a driver bug.

Aborted

Occurs when the user asked to close the connection or if the connection can't reconnect anymore.

ConnectionHasDropped 

data StreamId loc where Source #

Represents a regular stream name or $all stream.

Instances

Instances details
Eq (StreamId t) Source # 
Instance details

Defined in Database.EventStore.Internal.Stream

Methods

(==) :: StreamId t -> StreamId t -> Bool #

(/=) :: StreamId t -> StreamId t -> Bool #

Show (StreamId t) Source # 
Instance details

Defined in Database.EventStore.Internal.Stream

Methods

showsPrec :: Int -> StreamId t -> ShowS #

show :: StreamId t -> String #

showList :: [StreamId t] -> ShowS #

isAllStream :: StreamId t -> Bool Source #

If the stream is the $all stream.

isEventResolvedLink :: ResolvedEvent -> Bool Source #

Indicates whether this ResolvedEvent is a resolved link event.

resolvedEventOriginal :: ResolvedEvent -> RecordedEvent Source #

Returns the event that was read or which triggered the subscription.

If this ResolvedEvent represents a link event, the link will be the original event, otherwise it will be the event.

resolvedEventDataAsJson :: FromJSON a => ResolvedEvent -> Maybe a Source #

Tries to desarialize resolvedEventOriginal data as JSON.

resolvedEventOriginalStreamId :: ResolvedEvent -> Text Source #

The stream name of the original event.

resolvedEventOriginalId :: ResolvedEvent -> UUID Source #

The ID of the original event.

resolvedEventOriginalEventNumber :: ResolvedEvent -> Int64 Source #

The event number of the original event.

recordedEventDataAsJson :: FromJSON a => RecordedEvent -> Maybe a Source #

Tries to parse JSON object from the given RecordedEvent.

positionStart :: Position Source #

Representing the start of the transaction file.

positionEnd :: Position Source #

Representing the end of the transaction file.

Logging

data LogLevel #

Instances

Instances details
Eq LogLevel 
Instance details

Defined in Control.Monad.Logger

Ord LogLevel 
Instance details

Defined in Control.Monad.Logger

Read LogLevel 
Instance details

Defined in Control.Monad.Logger

Show LogLevel 
Instance details

Defined in Control.Monad.Logger

Lift LogLevel 
Instance details

Defined in Control.Monad.Logger

Monitoring

data MonitoringBackend Source #

Monitoring backend abstraction. Gathers all the metrics currently tracked by the client. Used only by the TCP interface. Be careful as MonitoringBackend is used in a very tight loop. Each function must not throw any exception or the client will end in a broken state.

Constructors

MonitoringBackend 

Fields

Misc

data Command Source #

Internal command representation.

Instances

Instances details
Eq Command Source # 
Instance details

Defined in Database.EventStore.Internal.Command

Methods

(==) :: Command -> Command -> Bool #

(/=) :: Command -> Command -> Bool #

Ord Command Source # 
Instance details

Defined in Database.EventStore.Internal.Command

Show Command Source # 
Instance details

Defined in Database.EventStore.Internal.Command

data ExpectedVersion Source #

Constants used for expected version control.

The use of expected version can be a bit tricky especially when discussing idempotency assurances given by the EventStore.

The EventStore will assure idempotency for all operations using any value in ExpectedVersion except for anyStream. When using anyStream the EventStore will do its best to assure idempotency but will not guarantee idempotency.

anyVersion :: ExpectedVersion Source #

This write should not conflict with anything and should always succeed.

noStreamVersion :: ExpectedVersion Source #

The stream being written to should not yet exist. If it does exist treat that as a concurrency problem.

emptyStreamVersion :: ExpectedVersion Source #

The stream should exist and should be empty. If it does not exist or is not empty, treat that as a concurrency problem.

exactEventVersion :: Int64 -> ExpectedVersion Source #

States that the last event written to the stream should have a sequence number matching your expected value.

streamExists :: ExpectedVersion Source #

The stream should exist. If it or a metadata stream does not exist treat that as a concurrency problem.

msDiffTime :: Float -> NominalDiffTime Source #

Millisecond timespan

Re-export

(<>) :: Semigroup a => a -> a -> a infixr 6 #

An associative operation.

>>> [1,2,3] <> [4,5,6]
[1,2,3,4,5,6]

data NonEmpty a #

Non-empty (and non-strict) list type.

Since: base-4.9.0.0

Constructors

a :| [a] infixr 5 

Instances

Instances details
Monad NonEmpty

Since: base-4.9.0.0

Instance details

Defined in GHC.Base

Methods

(>>=) :: NonEmpty a -> (a -> NonEmpty b) -> NonEmpty b #

(>>) :: NonEmpty a -> NonEmpty b -> NonEmpty b #

return :: a -> NonEmpty a #

Functor NonEmpty

Since: base-4.9.0.0

Instance details

Defined in GHC.Base

Methods

fmap :: (a -> b) -> NonEmpty a -> NonEmpty b #

(<$) :: a -> NonEmpty b -> NonEmpty a #

MonadFix NonEmpty

Since: base-4.9.0.0

Instance details

Defined in Control.Monad.Fix

Methods

mfix :: (a -> NonEmpty a) -> NonEmpty a #

Applicative NonEmpty

Since: base-4.9.0.0

Instance details

Defined in GHC.Base

Methods

pure :: a -> NonEmpty a #

(<*>) :: NonEmpty (a -> b) -> NonEmpty a -> NonEmpty b #

liftA2 :: (a -> b -> c) -> NonEmpty a -> NonEmpty b -> NonEmpty c #

(*>) :: NonEmpty a -> NonEmpty b -> NonEmpty b #

(<*) :: NonEmpty a -> NonEmpty b -> NonEmpty a #

Foldable NonEmpty

Since: base-4.9.0.0

Instance details

Defined in Data.Foldable

Methods

fold :: Monoid m => NonEmpty m -> m #

foldMap :: Monoid m => (a -> m) -> NonEmpty a -> m #

foldMap' :: Monoid m => (a -> m) -> NonEmpty a -> m #

foldr :: (a -> b -> b) -> b -> NonEmpty a -> b #

foldr' :: (a -> b -> b) -> b -> NonEmpty a -> b #

foldl :: (b -> a -> b) -> b -> NonEmpty a -> b #

foldl' :: (b -> a -> b) -> b -> NonEmpty a -> b #

foldr1 :: (a -> a -> a) -> NonEmpty a -> a #

foldl1 :: (a -> a -> a) -> NonEmpty a -> a #

toList :: NonEmpty a -> [a] #

null :: NonEmpty a -> Bool #

length :: NonEmpty a -> Int #

elem :: Eq a => a -> NonEmpty a -> Bool #

maximum :: Ord a => NonEmpty a -> a #

minimum :: Ord a => NonEmpty a -> a #

sum :: Num a => NonEmpty a -> a #

product :: Num a => NonEmpty a -> a #

Traversable NonEmpty

Since: base-4.9.0.0

Instance details

Defined in Data.Traversable

Methods

traverse :: Applicative f => (a -> f b) -> NonEmpty a -> f (NonEmpty b) #

sequenceA :: Applicative f => NonEmpty (f a) -> f (NonEmpty a) #

mapM :: Monad m => (a -> m b) -> NonEmpty a -> m (NonEmpty b) #

sequence :: Monad m => NonEmpty (m a) -> m (NonEmpty a) #

ToJSON1 NonEmpty 
Instance details

Defined in Data.Aeson.Types.ToJSON

Methods

liftToJSON :: (a -> Value) -> ([a] -> Value) -> NonEmpty a -> Value #

liftToJSONList :: (a -> Value) -> ([a] -> Value) -> [NonEmpty a] -> Value #

liftToEncoding :: (a -> Encoding) -> ([a] -> Encoding) -> NonEmpty a -> Encoding #

liftToEncodingList :: (a -> Encoding) -> ([a] -> Encoding) -> [NonEmpty a] -> Encoding #

FromJSON1 NonEmpty 
Instance details

Defined in Data.Aeson.Types.FromJSON

Methods

liftParseJSON :: (Value -> Parser a) -> (Value -> Parser [a]) -> Value -> Parser (NonEmpty a) #

liftParseJSONList :: (Value -> Parser a) -> (Value -> Parser [a]) -> Value -> Parser [NonEmpty a] #

Eq1 NonEmpty

Since: base-4.10.0.0

Instance details

Defined in Data.Functor.Classes

Methods

liftEq :: (a -> b -> Bool) -> NonEmpty a -> NonEmpty b -> Bool #

Ord1 NonEmpty

Since: base-4.10.0.0

Instance details

Defined in Data.Functor.Classes

Methods

liftCompare :: (a -> b -> Ordering) -> NonEmpty a -> NonEmpty b -> Ordering #

Read1 NonEmpty

Since: base-4.10.0.0

Instance details

Defined in Data.Functor.Classes

Methods

liftReadsPrec :: (Int -> ReadS a) -> ReadS [a] -> Int -> ReadS (NonEmpty a) #

liftReadList :: (Int -> ReadS a) -> ReadS [a] -> ReadS [NonEmpty a] #

liftReadPrec :: ReadPrec a -> ReadPrec [a] -> ReadPrec (NonEmpty a) #

liftReadListPrec :: ReadPrec a -> ReadPrec [a] -> ReadPrec [NonEmpty a] #

Show1 NonEmpty

Since: base-4.10.0.0

Instance details

Defined in Data.Functor.Classes

Methods

liftShowsPrec :: (Int -> a -> ShowS) -> ([a] -> ShowS) -> Int -> NonEmpty a -> ShowS #

liftShowList :: (Int -> a -> ShowS) -> ([a] -> ShowS) -> [NonEmpty a] -> ShowS #

NFData1 NonEmpty

Since: deepseq-1.4.3.0

Instance details

Defined in Control.DeepSeq

Methods

liftRnf :: (a -> ()) -> NonEmpty a -> () #

Hashable1 NonEmpty

Since: hashable-1.3.1.0

Instance details

Defined in Data.Hashable.Class

Methods

liftHashWithSalt :: (Int -> a -> Int) -> Int -> NonEmpty a -> Int #

Lift a => Lift (NonEmpty a :: Type)

Since: template-haskell-2.15.0.0

Instance details

Defined in Language.Haskell.TH.Syntax

Methods

lift :: NonEmpty a -> Q Exp #

liftTyped :: NonEmpty a -> Q (TExp (NonEmpty a)) #

IsList (NonEmpty a)

Since: base-4.9.0.0

Instance details

Defined in GHC.Exts

Associated Types

type Item (NonEmpty a) #

Methods

fromList :: [Item (NonEmpty a)] -> NonEmpty a #

fromListN :: Int -> [Item (NonEmpty a)] -> NonEmpty a #

toList :: NonEmpty a -> [Item (NonEmpty a)] #

Eq a => Eq (NonEmpty a)

Since: base-4.9.0.0

Instance details

Defined in GHC.Base

Methods

(==) :: NonEmpty a -> NonEmpty a -> Bool #

(/=) :: NonEmpty a -> NonEmpty a -> Bool #

Ord a => Ord (NonEmpty a)

Since: base-4.9.0.0

Instance details

Defined in GHC.Base

Methods

compare :: NonEmpty a -> NonEmpty a -> Ordering #

(<) :: NonEmpty a -> NonEmpty a -> Bool #

(<=) :: NonEmpty a -> NonEmpty a -> Bool #

(>) :: NonEmpty a -> NonEmpty a -> Bool #

(>=) :: NonEmpty a -> NonEmpty a -> Bool #

max :: NonEmpty a -> NonEmpty a -> NonEmpty a #

min :: NonEmpty a -> NonEmpty a -> NonEmpty a #

Read a => Read (NonEmpty a)

Since: base-4.11.0.0

Instance details

Defined in GHC.Read

Show a => Show (NonEmpty a)

Since: base-4.11.0.0

Instance details

Defined in GHC.Show

Methods

showsPrec :: Int -> NonEmpty a -> ShowS #

show :: NonEmpty a -> String #

showList :: [NonEmpty a] -> ShowS #

Generic (NonEmpty a)

Since: base-4.6.0.0

Instance details

Defined in GHC.Generics

Associated Types

type Rep (NonEmpty a) :: Type -> Type #

Methods

from :: NonEmpty a -> Rep (NonEmpty a) x #

to :: Rep (NonEmpty a) x -> NonEmpty a #

Semigroup (NonEmpty a)

Since: base-4.9.0.0

Instance details

Defined in GHC.Base

Methods

(<>) :: NonEmpty a -> NonEmpty a -> NonEmpty a #

sconcat :: NonEmpty (NonEmpty a) -> NonEmpty a #

stimes :: Integral b => b -> NonEmpty a -> NonEmpty a #

Hashable a => Hashable (NonEmpty a) 
Instance details

Defined in Data.Hashable.Class

Methods

hashWithSalt :: Int -> NonEmpty a -> Int #

hash :: NonEmpty a -> Int #

ToJSON a => ToJSON (NonEmpty a) 
Instance details

Defined in Data.Aeson.Types.ToJSON

FromJSON a => FromJSON (NonEmpty a) 
Instance details

Defined in Data.Aeson.Types.FromJSON

NFData a => NFData (NonEmpty a)

Since: deepseq-1.4.2.0

Instance details

Defined in Control.DeepSeq

Methods

rnf :: NonEmpty a -> () #

SemiSequence (NonEmpty a) 
Instance details

Defined in Data.Sequences

Associated Types

type Index (NonEmpty a) #

MonoFunctor (NonEmpty a) 
Instance details

Defined in Data.MonoTraversable

Methods

omap :: (Element (NonEmpty a) -> Element (NonEmpty a)) -> NonEmpty a -> NonEmpty a #

MonoFoldable (NonEmpty a) 
Instance details

Defined in Data.MonoTraversable

Methods

ofoldMap :: Monoid m => (Element (NonEmpty a) -> m) -> NonEmpty a -> m #

ofoldr :: (Element (NonEmpty a) -> b -> b) -> b -> NonEmpty a -> b #

ofoldl' :: (a0 -> Element (NonEmpty a) -> a0) -> a0 -> NonEmpty a -> a0 #

otoList :: NonEmpty a -> [Element (NonEmpty a)] #

oall :: (Element (NonEmpty a) -> Bool) -> NonEmpty a -> Bool #

oany :: (Element (NonEmpty a) -> Bool) -> NonEmpty a -> Bool #

onull :: NonEmpty a -> Bool #

olength :: NonEmpty a -> Int #

olength64 :: NonEmpty a -> Int64 #

ocompareLength :: Integral i => NonEmpty a -> i -> Ordering #

otraverse_ :: Applicative f => (Element (NonEmpty a) -> f b) -> NonEmpty a -> f () #

ofor_ :: Applicative f => NonEmpty a -> (Element (NonEmpty a) -> f b) -> f () #

omapM_ :: Applicative m => (Element (NonEmpty a) -> m ()) -> NonEmpty a -> m () #

oforM_ :: Applicative m => NonEmpty a -> (Element (NonEmpty a) -> m ()) -> m () #

ofoldlM :: Monad m => (a0 -> Element (NonEmpty a) -> m a0) -> a0 -> NonEmpty a -> m a0 #

ofoldMap1Ex :: Semigroup m => (Element (NonEmpty a) -> m) -> NonEmpty a -> m #

ofoldr1Ex :: (Element (NonEmpty a) -> Element (NonEmpty a) -> Element (NonEmpty a)) -> NonEmpty a -> Element (NonEmpty a) #

ofoldl1Ex' :: (Element (NonEmpty a) -> Element (NonEmpty a) -> Element (NonEmpty a)) -> NonEmpty a -> Element (NonEmpty a) #

headEx :: NonEmpty a -> Element (NonEmpty a) #

lastEx :: NonEmpty a -> Element (NonEmpty a) #

unsafeHead :: NonEmpty a -> Element (NonEmpty a) #

unsafeLast :: NonEmpty a -> Element (NonEmpty a) #

maximumByEx :: (Element (NonEmpty a) -> Element (NonEmpty a) -> Ordering) -> NonEmpty a -> Element (NonEmpty a) #

minimumByEx :: (Element (NonEmpty a) -> Element (NonEmpty a) -> Ordering) -> NonEmpty a -> Element (NonEmpty a) #

oelem :: Element (NonEmpty a) -> NonEmpty a -> Bool #

onotElem :: Element (NonEmpty a) -> NonEmpty a -> Bool #

MonoTraversable (NonEmpty a) 
Instance details

Defined in Data.MonoTraversable

Methods

otraverse :: Applicative f => (Element (NonEmpty a) -> f (Element (NonEmpty a))) -> NonEmpty a -> f (NonEmpty a) #

omapM :: Applicative m => (Element (NonEmpty a) -> m (Element (NonEmpty a))) -> NonEmpty a -> m (NonEmpty a) #

MonoPointed (NonEmpty a) 
Instance details

Defined in Data.MonoTraversable

Methods

opoint :: Element (NonEmpty a) -> NonEmpty a #

GrowingAppend (NonEmpty a) 
Instance details

Defined in Data.MonoTraversable

Generic1 NonEmpty

Since: base-4.6.0.0

Instance details

Defined in GHC.Generics

Associated Types

type Rep1 NonEmpty :: k -> Type #

Methods

from1 :: forall (a :: k). NonEmpty a -> Rep1 NonEmpty a #

to1 :: forall (a :: k). Rep1 NonEmpty a -> NonEmpty a #

type Rep (NonEmpty a) 
Instance details

Defined in GHC.Generics

type Item (NonEmpty a) 
Instance details

Defined in GHC.Exts

type Item (NonEmpty a) = a
type Index (NonEmpty a) 
Instance details

Defined in Data.Sequences

type Index (NonEmpty a) = Int
type Element (NonEmpty a) 
Instance details

Defined in Data.MonoTraversable

type Element (NonEmpty a) = a
type Rep1 NonEmpty 
Instance details

Defined in GHC.Generics

nonEmpty :: [a] -> Maybe (NonEmpty a) #

nonEmpty efficiently turns a normal list into a NonEmpty stream, producing Nothing if the input is empty.

data TLSSettings #

TLS Settings that can be either expressed as simple settings, or as full blown TLS.Params settings.

Unless you need access to parameters that are not accessible through the simple settings, you should use TLSSettingsSimple.

Instances

Instances details
Show TLSSettings 
Instance details

Defined in Network.Connection.Types

Default TLSSettings 
Instance details

Defined in Network.Connection.Types

Methods

def :: TLSSettings #

data NominalDiffTime #

This is a length of time, as measured by UTC. It has a precision of 10^-12 s.

Conversion functions will treat it as seconds. For example, (0.010 :: NominalDiffTime) corresponds to 10 milliseconds.

It ignores leap-seconds, so it's not necessarily a fixed amount of clock time. For instance, 23:00 UTC + 2 hours of NominalDiffTime = 01:00 UTC (+ 1 day), regardless of whether a leap-second intervened.

Instances

Instances details
Enum NominalDiffTime 
Instance details

Defined in Data.Time.Clock.Internal.NominalDiffTime

Eq NominalDiffTime 
Instance details

Defined in Data.Time.Clock.Internal.NominalDiffTime

Fractional NominalDiffTime 
Instance details

Defined in Data.Time.Clock.Internal.NominalDiffTime

Data NominalDiffTime 
Instance details

Defined in Data.Time.Clock.Internal.NominalDiffTime

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> NominalDiffTime -> c NominalDiffTime #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c NominalDiffTime #

toConstr :: NominalDiffTime -> Constr #

dataTypeOf :: NominalDiffTime -> DataType #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c NominalDiffTime) #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c NominalDiffTime) #

gmapT :: (forall b. Data b => b -> b) -> NominalDiffTime -> NominalDiffTime #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> NominalDiffTime -> r #

gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> NominalDiffTime -> r #

gmapQ :: (forall d. Data d => d -> u) -> NominalDiffTime -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> NominalDiffTime -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> NominalDiffTime -> m NominalDiffTime #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> NominalDiffTime -> m NominalDiffTime #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> NominalDiffTime -> m NominalDiffTime #

Num NominalDiffTime 
Instance details

Defined in Data.Time.Clock.Internal.NominalDiffTime

Ord NominalDiffTime 
Instance details

Defined in Data.Time.Clock.Internal.NominalDiffTime

Real NominalDiffTime 
Instance details

Defined in Data.Time.Clock.Internal.NominalDiffTime

RealFrac NominalDiffTime 
Instance details

Defined in Data.Time.Clock.Internal.NominalDiffTime

Show NominalDiffTime 
Instance details

Defined in Data.Time.Clock.Internal.NominalDiffTime

ToJSON NominalDiffTime 
Instance details

Defined in Data.Aeson.Types.ToJSON

FromJSON NominalDiffTime

This instance includes a bounds check to prevent maliciously large inputs to fill up the memory of the target system. You can newtype Scientific and provide your own instance using withScientific if you want to allow larger inputs.

Instance details

Defined in Data.Aeson.Types.FromJSON

NFData NominalDiffTime 
Instance details

Defined in Data.Time.Clock.Internal.NominalDiffTime

Methods

rnf :: NominalDiffTime -> () #