Safe Haskell | None |
---|---|
Language | Haskell2010 |
Temporal.Core.Client
Synopsis
- data Client
- clientConfig :: Client -> ClientConfig
- connectClient :: Runtime -> ClientConfig -> IO Client
- defaultClientConfig :: ClientConfig
- closeClient :: Client -> IO ()
- clientRuntime :: Client -> Runtime
- touchClient :: Client -> IO ()
- data CoreClient
- data ClientConfig = ClientConfig {}
- data ClientTlsConfig = ClientTlsConfig {}
- newtype ByteVector = ByteVector {}
- data ClientRetryConfig = ClientRetryConfig {}
- call :: forall svc (t :: Symbol). HasMethodImpl svc t => PrimRpcCall -> Client -> MethodInput svc t -> IO (Either RpcError (MethodOutput svc t))
- data RpcCall a = RpcCall {}
- data RpcError = RpcError {}
- data ClientError
- data CRpcCall
- type TokioCall e a = StablePtr PrimMVar -> Int -> TokioSlot e -> TokioSlot a -> IO ()
- type TokioResult a = ForeignPtr (Ptr a)
- type PrimRpcCall = Ptr CoreClient -> Ptr CRpcCall -> TokioCall CRPCError (CArray Word8)
- withClient :: Client -> (Ptr CoreClient -> IO a) -> IO a
Connecting to the server
A client connection to the Temporal server.
The client is thread-safe and can be shared across threads.
Clients are expensive to create, so you should generally create one per process and share it across your application..
The client doesn't have an explicit close method, but will be cleaned up when it is garbage collected.
clientConfig :: Client -> ClientConfig Source #
connectClient :: Runtime -> ClientConfig -> IO Client Source #
Connect to the Temporal server using a given runtime.
Throws ClientConnectionError
if the connection fails.
closeClient :: Client -> IO () Source #
clientRuntime :: Client -> Runtime Source #
touchClient :: Client -> IO () Source #
data CoreClient Source #
data ClientConfig Source #
Constructors
ClientConfig | |
Fields
|
Instances
FromJSON ClientConfig Source # | |
Defined in Temporal.Core.Client | |
ToJSON ClientConfig Source # | |
Defined in Temporal.Core.Client Methods toJSON :: ClientConfig -> Value # toEncoding :: ClientConfig -> Encoding # toJSONList :: [ClientConfig] -> Value # toEncodingList :: [ClientConfig] -> Encoding # omitField :: ClientConfig -> Bool # |
data ClientTlsConfig Source #
Constructors
ClientTlsConfig | |
Fields |
Instances
FromJSON ClientTlsConfig Source # | |
Defined in Temporal.Core.Client Methods parseJSON :: Value -> Parser ClientTlsConfig # parseJSONList :: Value -> Parser [ClientTlsConfig] # | |
ToJSON ClientTlsConfig Source # | |
Defined in Temporal.Core.Client Methods toJSON :: ClientTlsConfig -> Value # toEncoding :: ClientTlsConfig -> Encoding # toJSONList :: [ClientTlsConfig] -> Value # toEncodingList :: [ClientTlsConfig] -> Encoding # omitField :: ClientTlsConfig -> Bool # |
newtype ByteVector Source #
Constructors
ByteVector | |
Fields |
Instances
FromJSON ByteVector Source # | |
Defined in Temporal.Core.Client | |
ToJSON ByteVector Source # | |
Defined in Temporal.Core.Client Methods toJSON :: ByteVector -> Value # toEncoding :: ByteVector -> Encoding # toJSONList :: [ByteVector] -> Value # toEncodingList :: [ByteVector] -> Encoding # omitField :: ByteVector -> Bool # |
data ClientRetryConfig Source #
Constructors
ClientRetryConfig | |
Fields |
Instances
FromJSON ClientRetryConfig Source # | |
Defined in Temporal.Core.Client Methods parseJSON :: Value -> Parser ClientRetryConfig # parseJSONList :: Value -> Parser [ClientRetryConfig] # | |
ToJSON ClientRetryConfig Source # | |
Defined in Temporal.Core.Client Methods toJSON :: ClientRetryConfig -> Value # toEncoding :: ClientRetryConfig -> Encoding # toJSONList :: [ClientRetryConfig] -> Value # toEncodingList :: [ClientRetryConfig] -> Encoding # omitField :: ClientRetryConfig -> Bool # |
Making calls to the server
call :: forall svc (t :: Symbol). HasMethodImpl svc t => PrimRpcCall -> Client -> MethodInput svc t -> IO (Either RpcError (MethodOutput svc t)) Source #
Instances
Exception RpcError Source # | |
Defined in Temporal.Core.CTypes Methods toException :: RpcError -> SomeException # fromException :: SomeException -> Maybe RpcError # displayException :: RpcError -> String # backtraceDesired :: RpcError -> Bool # | |
Show RpcError Source # | |
data ClientError Source #
Constructors
ClientConnectionError Text | |
ClientClosedError |
Instances
Exception ClientError Source # | |
Defined in Temporal.Core.Client Methods toException :: ClientError -> SomeException # fromException :: SomeException -> Maybe ClientError # displayException :: ClientError -> String # backtraceDesired :: ClientError -> Bool # | |
Show ClientError Source # | |
Defined in Temporal.Core.Client Methods showsPrec :: Int -> ClientError -> ShowS # show :: ClientError -> String # showList :: [ClientError] -> ShowS # |
Primitive access
Instances
Storable CRpcCall Source # | |
Defined in Temporal.Core.CTypes |
type TokioResult a = ForeignPtr (Ptr a) Source #
type PrimRpcCall = Ptr CoreClient -> Ptr CRpcCall -> TokioCall CRPCError (CArray Word8) Source #
Use the underlying Rust client pointer
withClient :: Client -> (Ptr CoreClient -> IO a) -> IO a Source #