message-db-0.1.0.0: Client library for Message-DB installed in PostgreSQL.
Safe HaskellNone
LanguageHaskell2010

MessageDb.Projection

Description

A projection is an aggregation of all messages in a stream.

Synopsis

Documentation

data Projection state Source #

Defines how to perform a projection a stream.

Constructors

Projection 

Fields

data BatchSize Source #

Instances

Instances details
Eq BatchSize Source # 
Instance details

Defined in MessageDb.Functions

Show BatchSize Source # 
Instance details

Defined in MessageDb.Functions

data Projected state Source #

A projected state

Constructors

Projected 

Instances

Instances details
Functor Projected Source # 
Instance details

Defined in MessageDb.Projection

Methods

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

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

Eq state => Eq (Projected state) Source # 
Instance details

Defined in MessageDb.Projection

Methods

(==) :: Projected state -> Projected state -> Bool #

(/=) :: Projected state -> Projected state -> Bool #

Show state => Show (Projected state) Source # 
Instance details

Defined in MessageDb.Projection

Methods

showsPrec :: Int -> Projected state -> ShowS #

show :: Projected state -> String #

showList :: [Projected state] -> ShowS #

versionIncludingUnprocessed :: Projected state -> StreamVersion Source #

Version of the projection with unprocessed messages included.

project :: Projection state -> NonEmpty Message -> Projected state Source #

Project a state of a stream by aggregating messages.

fetch :: forall state. WithConnection -> BatchSize -> StreamName -> Projection state -> IO (Maybe (Projected state)) Source #

Query a stream and project the messages.