| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Pinch.Client
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 #
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
| ThriftClient MultiplexClient Source # | |
Defined in Pinch.Client Methods 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 Methods 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.
Constructors
| ApplicationException | |
Fields | |
Instances
| Eq ApplicationException Source # | |
Defined in Pinch.Internal.Exception Methods (==) :: ApplicationException -> ApplicationException -> Bool # (/=) :: ApplicationException -> ApplicationException -> Bool # | |
| Show ApplicationException Source # | |
Defined in Pinch.Internal.Exception Methods showsPrec :: Int -> ApplicationException -> ShowS # show :: ApplicationException -> String # showList :: [ApplicationException] -> ShowS # | |
| Exception ApplicationException Source # | |
Defined in Pinch.Internal.Exception Methods toException :: ApplicationException -> SomeException # fromException :: SomeException -> Maybe ApplicationException # | |
| Pinchable ApplicationException Source # | |
Defined in Pinch.Internal.Exception Associated Types type Tag ApplicationException Source # Methods pinch :: ApplicationException -> Value (Tag ApplicationException) Source # unpinch :: Value (Tag ApplicationException) -> Parser 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.
Constructors
| 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.
Constructors
| ThriftError Text |
Instances
| Eq ThriftError Source # | |
Defined in Pinch.Internal.Exception | |
| Show ThriftError Source # | |
Defined in Pinch.Internal.Exception Methods showsPrec :: Int -> ThriftError -> ShowS # show :: ThriftError -> String # showList :: [ThriftError] -> ShowS # | |
| Exception ThriftError Source # | |
Defined in Pinch.Internal.Exception Methods toException :: ThriftError -> SomeException # fromException :: SomeException -> Maybe ThriftError # displayException :: ThriftError -> String # | |