franz-0.5: Append-only database
Safe HaskellNone
LanguageHaskell2010

Database.Franz.Client

Synopsis

Documentation

data FranzPath Source #

Constructors

FranzPath 

Fields

LocalFranzPath !FilePath 

fromFranzPath :: (Monoid a, IsString a) => FranzPath -> a Source #

Render FranzPath as a franz URI.

toFranzPath :: String -> Either String FranzPath Source #

Parse a franz URI (franz:/host:portpath or franz-local:path).

data Query Source #

Constructors

Query 

Fields

Instances

Instances details
Show Query Source # 
Instance details

Defined in Database.Franz.Internal.Protocol

Methods

showsPrec :: Int -> Query -> ShowS #

show :: Query -> String #

showList :: [Query] -> ShowS #

Generic Query Source # 
Instance details

Defined in Database.Franz.Internal.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.Internal.Protocol

Methods

put :: Putter Query #

get :: Get Query #

type Rep Query Source # 
Instance details

Defined in Database.Franz.Internal.Protocol

type Rep Query = D1 ('MetaData "Query" "Database.Franz.Internal.Protocol" "franz-0.5-KxXJcuIWnOq5voPsLQF7IG" 'False) (C1 ('MetaCons "Query" 'PrefixI 'True) ((S1 ('MetaSel ('Just "reqStream") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 StreamName) :*: S1 ('MetaSel ('Just "reqFrom") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 ItemRef)) :*: (S1 ('MetaSel ('Just "reqTo") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 ItemRef) :*: S1 ('MetaSel ('Just "reqType") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 RequestType))))

data ItemRef Source #

Constructors

BySeqNum !Int

sequential number

ByIndex !IndexName !Int

index name and value

Instances

Instances details
Show ItemRef Source # 
Instance details

Defined in Database.Franz.Internal.Protocol

Generic ItemRef Source # 
Instance details

Defined in Database.Franz.Internal.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.Internal.Protocol

type Rep ItemRef Source # 
Instance details

Defined in Database.Franz.Internal.Protocol

type Rep ItemRef = D1 ('MetaData "ItemRef" "Database.Franz.Internal.Protocol" "franz-0.5-KxXJcuIWnOq5voPsLQF7IG" 'False) (C1 ('MetaCons "BySeqNum" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Int)) :+: C1 ('MetaCons "ByIndex" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 IndexName) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Int)))

data RequestType Source #

Constructors

AllItems 
LastItem 

Instances

Instances details
Show RequestType Source # 
Instance details

Defined in Database.Franz.Internal.Protocol

Generic RequestType Source # 
Instance details

Defined in Database.Franz.Internal.Protocol

Associated Types

type Rep RequestType :: Type -> Type #

Serialize RequestType Source # 
Instance details

Defined in Database.Franz.Internal.Protocol

type Rep RequestType Source # 
Instance details

Defined in Database.Franz.Internal.Protocol

type Rep RequestType = D1 ('MetaData "RequestType" "Database.Franz.Internal.Protocol" "franz-0.5-KxXJcuIWnOq5voPsLQF7IG" '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.

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 (Maybe Contents) 

Send a single query and wait for the result.

atomicallyWithin Source #

Arguments

:: Int

timeout in microseconds

-> STM a 
-> IO (Maybe a) 

data FranzException Source #

Instances

Instances details
Show FranzException Source # 
Instance details

Defined in Database.Franz.Internal.Protocol

Generic FranzException Source # 
Instance details

Defined in Database.Franz.Internal.Protocol

Associated Types

type Rep FranzException :: Type -> Type #

Exception FranzException Source # 
Instance details

Defined in Database.Franz.Internal.Protocol

Serialize FranzException Source # 
Instance details

Defined in Database.Franz.Internal.Protocol

type Rep FranzException Source # 
Instance details

Defined in Database.Franz.Internal.Protocol