grapesy
Safe HaskellNone
LanguageHaskell2010

Network.GRPC.Client.StreamType.IO.Binary

Description

Wrap Network.GRPC.Client.StreamType.IO to handle binary serialization

  • *NOTE**: The custom binary gRPC format provided by grapesy is designed so that the type of each message during communication can be different. The wrappers in this module lose this generalization: every input and every output must be of the same type. If this is too severe a limitaiton, you should use the functionality from Network.GRPC.Client.Binary instead.
Synopsis

Run client handlers

nonStreaming :: forall {k} inp out (rpc :: k) m. (Binary inp, Input rpc ~ ByteString, Binary out, Output rpc ~ ByteString, MonadIO m) => Connection -> ClientHandler' 'NonStreaming (ReaderT Connection m) rpc -> inp -> m out Source #

Wrapper for nonStreaming that handles binary serialization

clientStreaming :: forall {k} inp out (rpc :: k) m r. (Binary inp, Input rpc ~ ByteString, Binary out, Output rpc ~ ByteString, MonadIO m) => Connection -> ClientHandler' 'ClientStreaming (ReaderT Connection m) rpc -> ((NextElem inp -> m ()) -> m r) -> m (out, r) Source #

Wrapper for clientStreaming that handles binary serialization

clientStreaming_ :: forall {k} inp out (rpc :: k) m. (Binary inp, Input rpc ~ ByteString, Binary out, Output rpc ~ ByteString, MonadIO m) => Connection -> ClientHandler' 'ClientStreaming (ReaderT Connection m) rpc -> ((NextElem inp -> m ()) -> m ()) -> m out Source #

Wrapper for clientStreaming_ that handles binary serialization

serverStreaming :: forall {k} inp out (rpc :: k) m r. (Binary inp, Input rpc ~ ByteString, Binary out, Output rpc ~ ByteString, MonadIO m) => Connection -> ClientHandler' 'ServerStreaming (ReaderT Connection m) rpc -> inp -> (m (NextElem out) -> m r) -> m r Source #

Wrapper for serverStreaming that binary serialization

biDiStreaming :: forall {k} inp out (rpc :: k) m r. (Binary inp, Input rpc ~ ByteString, Binary out, Output rpc ~ ByteString, MonadIO m) => Connection -> ClientHandler' 'BiDiStreaming (ReaderT Connection m) rpc -> ((NextElem inp -> m ()) -> m (NextElem out) -> m r) -> m r Source #

Wrapper for biDiStreaming that handles binary serialization