pinch-0.4.1.2: An alternative implementation of Thrift for Haskell.
Safe HaskellNone
LanguageHaskell2010

Pinch.Client

Synopsis

Basic Thrift client

data Client Source #

A simple Thrift Client.

Instances

Instances details
ThriftClient Client Source # 
Instance details

Defined in Pinch.Client

Methods

call :: Client -> ThriftCall a -> IO a Source #

client :: Channel -> Client Source #

Instantiates a new Thrift client.

data Channel Source #

A bi-directional channel to read/write Thrift messages.

createChannel :: Connection c => c -> (c -> IO Transport) -> Protocol -> IO Channel Source #

Creates a channel using the same transport/protocol for both directions.

data ThriftCall a where Source #

A call to a Thrift server resulting in the return datatype a.

Constructors

TCall :: (Pinchable req, Tag req ~ TStruct, Pinchable res, Tag res ~ TStruct) => !Text -> !req -> ThriftCall res 
TOneway :: (Pinchable req, Tag req ~ TStruct) => !Text -> !req -> ThriftCall () 

class ThriftClient c where Source #

Methods

call :: c -> ThriftCall a -> IO a Source #

Calls a Thrift service and returns the result/error data structure. Application-level exceptions defined in the thrift service are returned as part of the result/error data structure.

Instances

Instances details
ThriftClient MultiplexClient Source # 
Instance details

Defined in Pinch.Client

ThriftClient Client Source # 
Instance details

Defined in Pinch.Client

Methods

call :: Client -> ThriftCall a -> IO a Source #

callOrThrow :: (ThriftClient c, ThriftResult a) => c -> ThriftCall a -> IO (ResultType a) Source #

Calls a Thrift service. If an application-level thrift exception as defined in the Thrift service definition is returned by the server, it will be re-thrown using throwIO.

Multiplexing Client

data MultiplexClient Source #

A multiplexing thrift client.

Instances

Instances details
ThriftClient MultiplexClient Source # 
Instance details

Defined in Pinch.Client

multiplexClient :: ThriftClient c => c -> ServiceName -> MultiplexClient Source #

Create a new multiplexing thrift client targeting the given service.

Errors

data ExceptionType Source #

data ThriftError Source #

An error occured while processing a thrift call. Signals errors like premature EOF, Thrift protocol parsing failures etc.

Constructors

ThriftError Text