grapesy
Safe HaskellNone
LanguageHaskell2010

Network.GRPC.Client.StreamType.CanCallRPC

Description

Like Network.GRPC.Client.StreamType.IO, but with an implicit Connection

These functions are useful in a monad stack in which the Connection object is implicitly available; you must provide an instance of CanCallRPC.

Synopsis

Documentation

class (MonadIO m, MonadMask m) => CanCallRPC (m :: Type -> Type) where Source #

Monads in which we make RPC calls

In order to be able to make an RPC call, we need

Instances

Instances details
(MonadIO m, MonadMask m) => CanCallRPC (ReaderT Connection m) Source # 
Instance details

Defined in Network.GRPC.Client.StreamType

Running client handlers

nonStreaming :: forall {k} (rpc :: k) m. ClientHandler' 'NonStreaming m rpc -> Input rpc -> m (Output rpc) Source #

Execute non-streaming handler in any monad stack

clientStreaming :: forall {k} (rpc :: k) m r. ClientHandler' 'ClientStreaming m rpc -> ((NextElem (Input rpc) -> IO ()) -> m r) -> m (Output rpc, r) Source #

Generalization of clientStreaming_ with an additional result

clientStreaming_ :: forall {k} (rpc :: k) m. Functor m => ClientHandler' 'ClientStreaming m rpc -> ((NextElem (Input rpc) -> IO ()) -> m ()) -> m (Output rpc) Source #

Execute client-side streaming handler in any monad stack

serverStreaming :: forall {k} (rpc :: k) m r. Functor m => ClientHandler' 'ServerStreaming m rpc -> Input rpc -> (IO (NextElem (Output rpc)) -> m r) -> m r Source #

Execute server-side streaming handler in any monad stack

biDiStreaming :: forall {k} (rpc :: k) m r. Functor m => ClientHandler' 'BiDiStreaming m rpc -> ((NextElem (Input rpc) -> IO ()) -> IO (NextElem (Output rpc)) -> m r) -> m r Source #

Execute bidirectional streaming handler in any monad stack