franz-0.3.0.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.Protocol

Methods

showsPrec :: Int -> Query -> ShowS #

show :: Query -> String #

showList :: [Query] -> ShowS #

Generic Query Source # 
Instance details

Defined in Database.Franz.Protocol

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.Protocol

Methods

put :: Putter Query #

get :: Get Query #

type Rep Query Source # 
Instance details

Defined in Database.Franz.Protocol

data ItemRef Source #

Constructors

BySeqNum !Int

sequential number

ByIndex !IndexName !Int

index name and value

Instances
Show ItemRef Source # 
Instance details

Defined in Database.Franz.Protocol

Generic ItemRef Source # 
Instance details

Defined in Database.Franz.Protocol

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.Protocol

type Rep ItemRef Source # 
Instance details

Defined in Database.Franz.Protocol

data RequestType Source #

Constructors

AllItems 
LastItem 
Instances
Show RequestType Source # 
Instance details

Defined in Database.Franz.Protocol

Generic RequestType Source # 
Instance details

Defined in Database.Franz.Protocol

Associated Types

type Rep RequestType :: Type -> Type #

Serialize RequestType Source # 
Instance details

Defined in Database.Franz.Protocol

type Rep RequestType Source # 
Instance details

Defined in Database.Franz.Protocol

type Rep RequestType = D1 (MetaData "RequestType" "Database.Franz.Protocol" "franz-0.3.0.1-4eG3N4JtDSvJ7a7VTycdfn" 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 = Vector (Int, SomeIndexMap, ByteString) Source #

(seqno, indices, payloads)

fetch Source #

Arguments

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

Wait for the response in a blocking manner. You should only run the continuation inside a fetch block: leaking the STM action and running it outside will result in a ClientError exception.

-> IO r 

Fetch requested data from the server.

Termination of fetch continuation cancels the request, allowing flexible control of its lifetime.

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.Protocol

Generic FranzException Source # 
Instance details

Defined in Database.Franz.Protocol

Associated Types

type Rep FranzException :: Type -> Type #

Exception FranzException Source # 
Instance details

Defined in Database.Franz.Protocol

Serialize FranzException Source # 
Instance details

Defined in Database.Franz.Protocol

type Rep FranzException Source # 
Instance details

Defined in Database.Franz.Protocol