pinch-0.4.3.0: An alternative implementation of Thrift for Haskell.
Safe HaskellSafe-Inferred
LanguageHaskell2010

Pinch.Internal.RPC

Synopsis

Documentation

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 ReadResult a Source #

Constructors

RRSuccess a 
RRFailure String 
RREOF 

Instances

Instances details
Show a => Show (ReadResult a) Source # 
Instance details

Defined in Pinch.Transport

Eq a => Eq (ReadResult a) Source # 
Instance details

Defined in Pinch.Transport

Methods

(==) :: ReadResult a -> ReadResult a -> Bool #

(/=) :: ReadResult a -> ReadResult a -> Bool #

newtype ServiceName Source #

Constructors

ServiceName Text 

Instances

Instances details
IsString ServiceName Source # 
Instance details

Defined in Pinch.Internal.RPC

Eq ServiceName Source # 
Instance details

Defined in Pinch.Internal.RPC

Hashable ServiceName Source # 
Instance details

Defined in Pinch.Internal.RPC

ContextItem ServiceName Source # 
Instance details

Defined in Pinch.Server

class (Pinchable a, Tag a ~ TStruct) => ThriftResult a where Source #

The Result datatype for a Thrift Service Method.

Associated Types

type ResultType a Source #

The Haskell type returned when the Thrift call succeeds.

Methods

unwrap :: a -> IO (ResultType a) Source #

Tries to extract the result from a Thrift call. If the call threw any of the Thrift exceptions declared for this Thrift service method, the corresponding Haskell excpetions is thrown using throwIO.

wrap :: IO (ResultType a) -> IO a Source #

Runs the given computation. If it throws any of the exceptions declared in the Thrift service definition, it is caught and converted to the corresponding Haskell result datatype constructor.

Instances

Instances details
ThriftResult Unit Source # 
Instance details

Defined in Pinch.Internal.RPC

Associated Types

type ResultType Unit Source #

data Unit Source #

Result datatype for void methods not throwing any exceptions.

Constructors

Unit 

Instances

Instances details
Pinchable Unit Source # 
Instance details

Defined in Pinch.Internal.RPC

Associated Types

type Tag Unit Source #

ThriftResult Unit Source # 
Instance details

Defined in Pinch.Internal.RPC

Associated Types

type ResultType Unit Source #

type Tag Unit Source # 
Instance details

Defined in Pinch.Internal.RPC

type ResultType Unit Source # 
Instance details

Defined in Pinch.Internal.RPC

type ResultType Unit = ()