franz-0.2.1: Append-only database

Safe HaskellNone
LanguageHaskell2010

Database.Franz.Network

Synopsis

Documentation

data Query Source #

Constructors

Query 

Fields

Instances
Show Query Source # 
Instance details

Defined in Database.Franz.Reader

Methods

showsPrec :: Int -> Query -> ShowS #

show :: Query -> String #

showList :: [Query] -> ShowS #

Generic Query Source # 
Instance details

Defined in Database.Franz.Reader

Associated Types

type Rep Query :: Type -> Type #

Methods

from :: Query -> Rep Query x #

to :: Rep Query x -> Query #

Serialize Query Source # 
Instance details

Defined in Database.Franz.Reader

Methods

put :: Putter Query #

get :: Get Query #

type Rep Query Source # 
Instance details

Defined in Database.Franz.Reader

data ItemRef Source #

Constructors

BySeqNum !Int

sequential number

ByIndex !ByteString !Int

index name and value

Instances
Show ItemRef Source # 
Instance details

Defined in Database.Franz.Reader

Generic ItemRef Source # 
Instance details

Defined in Database.Franz.Reader

Associated Types

type Rep ItemRef :: Type -> Type #

Methods

from :: ItemRef -> Rep ItemRef x #

to :: Rep ItemRef x -> ItemRef #

Serialize ItemRef Source # 
Instance details

Defined in Database.Franz.Reader

type Rep ItemRef Source # 
Instance details

Defined in Database.Franz.Reader

data RequestType Source #

Constructors

AllItems 
LastItem 
Instances
Show RequestType Source # 
Instance details

Defined in Database.Franz.Reader

Generic RequestType Source # 
Instance details

Defined in Database.Franz.Reader

Associated Types

type Rep RequestType :: Type -> Type #

Serialize RequestType Source # 
Instance details

Defined in Database.Franz.Reader

type Rep RequestType Source # 
Instance details

Defined in Database.Franz.Reader

type Rep RequestType = D1 (MetaData "RequestType" "Database.Franz.Reader" "franz-0.2.1-DMs1sFxJDSYKCecIbcBQYI" False) (C1 (MetaCons "AllItems" PrefixI False) (U1 :: Type -> Type) :+: C1 (MetaCons "LastItem" PrefixI False) (U1 :: Type -> Type))

type Response = Either Contents (STM Contents) Source #

When it is Right, it might block until the content arrives.

type Contents = [(Int, SomeIndexMap, ByteString)] Source #

(seqno, indices, payloads)

fetch Source #

Arguments

:: Connection 
-> Query 
-> (STM Response -> IO r)

running the STM action blocks until the response arrives

-> IO r 

Fetch requested data from the server. Termination of the continuation cancels the request, allowing flexible control of its lifetime.

fetchTraverse :: Traversable t => Connection -> t Query -> (STM (Either (t Contents) (STM (t Contents))) -> IO r) -> IO r Source #

Queries in traversable t form an atomic request. The response will become available once all the elements are available.

Generalisation to Traversable guarantees that the response preserves the shape of the request.

fetchSimple Source #

Arguments

:: Connection 
-> Int

timeout in microseconds

-> Query 
-> IO Contents 

Send a single query and wait for the result. If it timeouts, it returns an empty list.

atomicallyWithin Source #

Arguments

:: Int

timeout in microseconds

-> STM a 
-> IO (Maybe a) 

data FranzException Source #

Instances
Show FranzException Source # 
Instance details

Defined in Database.Franz.Reader

Generic FranzException Source # 
Instance details

Defined in Database.Franz.Reader

Associated Types

type Rep FranzException :: Type -> Type #

Exception FranzException Source # 
Instance details

Defined in Database.Franz.Reader

Serialize FranzException Source # 
Instance details

Defined in Database.Franz.Reader

type Rep FranzException Source # 
Instance details

Defined in Database.Franz.Reader