Safe Haskell | None |
---|---|
Language | Haskell2010 |
- data RPCServerParams rep com m = RPCServerParams {}
- type RPCServer sub sup rep com m = RPCServerParams rep com m -> Either sub sup -> m ()
- rpcServer :: forall sub sup rep com m. (ToJSON rep, ToJSON com, FromJSON sub, FromJSON sup, MonadIO m, MonadThrow m, MonadBaseControl IO m) => RPCServer sub sup rep com m -> ServerAppT (WebSocketServerRPCT sub sup m)
- data RPCClientParams sup m = RPCClientParams {}
- data RPCClient sub sup rep com m = RPCClient {
- subscription :: !sub
- onSubscribe :: RPCClientParams sup m -> m ()
- onReply :: RPCClientParams sup m -> rep -> m ()
- onComplete :: com -> m ()
- rpcClient :: forall sub sup rep com m. (ToJSON sub, ToJSON sup, FromJSON rep, FromJSON com, MonadIO m, MonadThrow m, MonadCatch m) => ((RPCClient sub sup rep com m -> WebSocketClientRPCT rep com m ()) -> WebSocketClientRPCT rep com m ()) -> ClientAppT (WebSocketClientRPCT rep com m) ()
- data WebSocketServerRPCT sub sup m a
- execWebSocketServerRPCT :: MonadIO m => WebSocketServerRPCT sub sup m a -> m a
- data WebSocketClientRPCT rep com m a
- execWebSocketClientRPCT :: MonadIO m => WebSocketClientRPCT rep com m a -> m a
- data WebSocketRPCException = WebSocketRPCParseFailure [String] ByteString
- runClientAppTBackingOff :: (forall a. m a -> IO a) -> String -> Int -> String -> ClientAppT m () -> IO ()
- rpcServerSimple :: forall sub sup rep com m. (MonadBaseControl IO m, MonadIO m) => RPCServer sub sup rep com m -> WebSocketsApp (Either (Reply rep) (Complete com)) (Either (Subscribe sub) (Supply sup)) (WebSocketServerRPCT sub sup m)
- rpcClientSimple :: forall sub sup rep com m. MonadIO m => RPCClient sub sup rep com m -> WebSocketClientRPCT rep com m (WebSocketsApp (Either (Subscribe sub) (Supply sup)) (Either (Reply rep) (Complete com)) (WebSocketClientRPCT rep com m))
- runWebSocketClientRPCTSimple :: Monad m => (forall a. WebSocketClientRPCT rep com m a -> m a) -> WebSocketsApp (Either (Subscribe sub) (Supply sup)) (Either (Reply rep) (Complete com)) (WebSocketClientRPCT rep com m) -> WebSocketsApp (Either (Subscribe sub) (Supply sup)) (Either (Reply rep) (Complete com)) m
- execWebSocketClientRPCTSimple :: MonadBaseControl IO m => WebSocketsApp (Either (Subscribe sub) (Supply sup)) (Either (Reply rep) (Complete com)) (WebSocketClientRPCT rep com m) -> m (WebSocketsApp (Either (Subscribe sub) (Supply sup)) (Either (Reply rep) (Complete com)) m)
- runWebSocketServerRPCTSimple :: Monad m => (forall a. WebSocketServerRPCT sub sup m a -> m a) -> WebSocketsApp (Either (Reply rep) (Complete com)) (Either (Subscribe sub) (Supply sup)) (WebSocketServerRPCT sub sup m) -> WebSocketsApp (Either (Reply rep) (Complete com)) (Either (Subscribe sub) (Supply sup)) m
- execWebSocketServerRPCTSimple :: MonadBaseControl IO m => WebSocketsApp (Either (Reply rep) (Complete com)) (Either (Subscribe sub) (Supply sup)) (WebSocketServerRPCT sub sup m) -> m (WebSocketsApp (Either (Reply rep) (Complete com)) (Either (Subscribe sub) (Supply sup)) m)
Server
data RPCServerParams rep com m Source #
type RPCServer sub sup rep com m Source #
= RPCServerParams rep com m | |
-> Either sub sup | handle incoming message |
-> m () |
rpcServer :: forall sub sup rep com m. (ToJSON rep, ToJSON com, FromJSON sub, FromJSON sup, MonadIO m, MonadThrow m, MonadBaseControl IO m) => RPCServer sub sup rep com m -> ServerAppT (WebSocketServerRPCT sub sup m) Source #
May throw a WebSocketRPCParseFailure
if the opposing party sends bad data
Client
data RPCClientParams sup m Source #
data RPCClient sub sup rep com m Source #
RPCClient | |
|
rpcClient :: forall sub sup rep com m. (ToJSON sub, ToJSON sup, FromJSON rep, FromJSON com, MonadIO m, MonadThrow m, MonadCatch m) => ((RPCClient sub sup rep com m -> WebSocketClientRPCT rep com m ()) -> WebSocketClientRPCT rep com m ()) -> ClientAppT (WebSocketClientRPCT rep com m) () Source #
May throw a WebSocketRPCParseFailure
if the opposing party sends bad data
Re-Exports
data WebSocketServerRPCT sub sup m a Source #
MonadReader r m => MonadReader r (WebSocketServerRPCT sub sup m) Source # | |
MonadState s m => MonadState s (WebSocketServerRPCT sub sup m) Source # | |
MonadWriter w m => MonadWriter w (WebSocketServerRPCT sub sup m) Source # | |
MonadTrans (WebSocketServerRPCT sub sup) Source # | |
Monad m => Monad (WebSocketServerRPCT sub sup m) Source # | |
Functor m => Functor (WebSocketServerRPCT sub sup m) Source # | |
Applicative m => Applicative (WebSocketServerRPCT sub sup m) Source # | |
MonadIO m => MonadIO (WebSocketServerRPCT sub sup m) Source # | |
MonadThrow m => MonadThrow (WebSocketServerRPCT sub sup m) Source # | |
MonadCatch m => MonadCatch (WebSocketServerRPCT sub sup m) Source # | |
MonadMask m => MonadMask (WebSocketServerRPCT sub sup m) Source # | |
Generic (WebSocketServerRPCT sub sup m a) Source # | |
type Rep (WebSocketServerRPCT sub sup m a) Source # | |
execWebSocketServerRPCT :: MonadIO m => WebSocketServerRPCT sub sup m a -> m a Source #
data WebSocketClientRPCT rep com m a Source #
MonadReader r m => MonadReader r (WebSocketClientRPCT rep com m) Source # | |
MonadState s m => MonadState s (WebSocketClientRPCT rep com m) Source # | |
MonadWriter w m => MonadWriter w (WebSocketClientRPCT rep com m) Source # | |
MonadTrans (WebSocketClientRPCT rep com) Source # | |
Monad m => Monad (WebSocketClientRPCT rep com m) Source # | |
Functor m => Functor (WebSocketClientRPCT rep com m) Source # | |
Applicative m => Applicative (WebSocketClientRPCT rep com m) Source # | |
MonadIO m => MonadIO (WebSocketClientRPCT rep com m) Source # | |
MonadThrow m => MonadThrow (WebSocketClientRPCT rep com m) Source # | |
MonadCatch m => MonadCatch (WebSocketClientRPCT rep com m) Source # | |
MonadMask m => MonadMask (WebSocketClientRPCT rep com m) Source # | |
Generic (WebSocketClientRPCT rep com m a) Source # | |
type Rep (WebSocketClientRPCT rep com m a) Source # | |
execWebSocketClientRPCT :: MonadIO m => WebSocketClientRPCT rep com m a -> m a Source #
data WebSocketRPCException Source #
runClientAppTBackingOff :: (forall a. m a -> IO a) -> String -> Int -> String -> ClientAppT m () -> IO () Source #
rpcServerSimple :: forall sub sup rep com m. (MonadBaseControl IO m, MonadIO m) => RPCServer sub sup rep com m -> WebSocketsApp (Either (Reply rep) (Complete com)) (Either (Subscribe sub) (Supply sup)) (WebSocketServerRPCT sub sup m) Source #
Note that this does not ping-pong.
rpcClientSimple :: forall sub sup rep com m. MonadIO m => RPCClient sub sup rep com m -> WebSocketClientRPCT rep com m (WebSocketsApp (Either (Subscribe sub) (Supply sup)) (Either (Reply rep) (Complete com)) (WebSocketClientRPCT rep com m)) Source #
Note, does not support pingpong
runWebSocketClientRPCTSimple :: Monad m => (forall a. WebSocketClientRPCT rep com m a -> m a) -> WebSocketsApp (Either (Subscribe sub) (Supply sup)) (Either (Reply rep) (Complete com)) (WebSocketClientRPCT rep com m) -> WebSocketsApp (Either (Subscribe sub) (Supply sup)) (Either (Reply rep) (Complete com)) m Source #
execWebSocketClientRPCTSimple :: MonadBaseControl IO m => WebSocketsApp (Either (Subscribe sub) (Supply sup)) (Either (Reply rep) (Complete com)) (WebSocketClientRPCT rep com m) -> m (WebSocketsApp (Either (Subscribe sub) (Supply sup)) (Either (Reply rep) (Complete com)) m) Source #
runWebSocketServerRPCTSimple :: Monad m => (forall a. WebSocketServerRPCT sub sup m a -> m a) -> WebSocketsApp (Either (Reply rep) (Complete com)) (Either (Subscribe sub) (Supply sup)) (WebSocketServerRPCT sub sup m) -> WebSocketsApp (Either (Reply rep) (Complete com)) (Either (Subscribe sub) (Supply sup)) m Source #
execWebSocketServerRPCTSimple :: MonadBaseControl IO m => WebSocketsApp (Either (Reply rep) (Complete com)) (Either (Subscribe sub) (Supply sup)) (WebSocketServerRPCT sub sup m) -> m (WebSocketsApp (Either (Reply rep) (Complete com)) (Either (Subscribe sub) (Supply sup)) m) Source #