Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- data Client
- client :: Channel -> Client
- data Channel
- createChannel :: Connection c => c -> (c -> IO Transport) -> Protocol -> IO Channel
- createChannel1 :: (Transport, Protocol) -> (Transport, Protocol) -> Channel
- data ThriftCall a where
- class ThriftClient c where
- call :: c -> ThriftCall a -> IO a
- callOrThrow :: (ThriftClient c, ThriftResult a) => c -> ThriftCall a -> IO (ResultType a)
- data MultiplexClient
- multiplexClient :: ThriftClient c => c -> ServiceName -> MultiplexClient
- data ApplicationException = ApplicationException {}
- data ExceptionType
- data ThriftError = ThriftError Text
Basic Thrift client
A simple Thrift Client.
Instances
ThriftClient Client Source # | |
Defined in Pinch.Client |
createChannel :: Connection c => c -> (c -> IO Transport) -> Protocol -> IO Channel Source #
Creates a channel using the same transport/protocol for both directions.
createChannel1 :: (Transport, Protocol) -> (Transport, Protocol) -> Channel Source #
Creates a channel.
data ThriftCall a where Source #
A call to a Thrift server resulting in the return datatype a
.
class ThriftClient c where Source #
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
ThriftClient MultiplexClient Source # | |
Defined in Pinch.Client call :: MultiplexClient -> ThriftCall a -> IO a Source # | |
ThriftClient Client Source # | |
Defined in Pinch.Client |
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
ThriftClient MultiplexClient Source # | |
Defined in Pinch.Client call :: MultiplexClient -> ThriftCall a -> IO a Source # |
multiplexClient :: ThriftClient c => c -> ServiceName -> MultiplexClient Source #
Create a new multiplexing thrift client targeting the given service.
Errors
data ApplicationException Source #
Thrift application exception as defined in https://github.com/apache/thrift/blob/master/doc/specs/thrift-rpc.md#response-struct.
Instances
Eq ApplicationException Source # | |
Defined in Pinch.Internal.Exception (==) :: ApplicationException -> ApplicationException -> Bool # (/=) :: ApplicationException -> ApplicationException -> Bool # | |
Show ApplicationException Source # | |
Defined in Pinch.Internal.Exception showsPrec :: Int -> ApplicationException -> ShowS # show :: ApplicationException -> String # showList :: [ApplicationException] -> ShowS # | |
Exception ApplicationException Source # | |
Pinchable ApplicationException Source # | |
Defined in Pinch.Internal.Exception type Tag ApplicationException Source # | |
type Tag ApplicationException Source # | |
Defined in Pinch.Internal.Exception |
data ExceptionType Source #
Thrift exception type as defined in https://github.com/apache/thrift/blob/master/doc/specs/thrift-rpc.md#response-struct.
Unknown | |
UnknownMethod | |
InvalidMessageType | |
WrongMethodName | |
BadSequenceId | |
MissingResult | |
InternalError | |
ProtocolError | |
InvalidTransform | |
InvalidProtocol | |
UnsupportedClientType |
Instances
data ThriftError Source #
An error occured while processing a thrift call. Signals errors like premature EOF, Thrift protocol parsing failures etc.
Instances
Eq ThriftError Source # | |
Defined in Pinch.Internal.Exception (==) :: ThriftError -> ThriftError -> Bool # (/=) :: ThriftError -> ThriftError -> Bool # | |
Show ThriftError Source # | |
Defined in Pinch.Internal.Exception showsPrec :: Int -> ThriftError -> ShowS # show :: ThriftError -> String # showList :: [ThriftError] -> ShowS # | |
Exception ThriftError Source # | |
Defined in Pinch.Internal.Exception |