Safe Haskell | None |
---|---|
Language | Haskell2010 |
- data WebSocketsAppParams send m = WebSocketsAppParams {}
- data WebSocketsApp send receive m = WebSocketsApp {
- onOpen :: WebSocketsAppParams send m -> m ()
- onReceive :: WebSocketsAppParams send m -> receive -> m ()
- onClose :: Maybe (Word16, ByteString) -> m ()
- hoistWebSocketsApp :: (forall a. m a -> n a) -> (forall a. n a -> m a) -> WebSocketsApp send receive m -> WebSocketsApp send receive n
- toClientAppT :: forall send receive m. (ToJSON send, FromJSON receive, MonadBaseControl IO m, MonadThrow m, MonadCatch m) => WebSocketsApp send receive m -> ClientAppT m (Maybe WebSocketsAppThreads)
- toClientAppT' :: (ToJSON send, FromJSON receive, MonadBaseControl IO m, MonadThrow m, MonadCatch m) => WebSocketsApp send receive m -> ClientAppT m ()
- toServerAppT :: (ToJSON send, FromJSON receive, MonadBaseControl IO m, MonadThrow m, MonadCatch m) => WebSocketsApp send receive m -> ServerAppT m
- expBackoffStrategy :: forall m a. (MonadBaseControl IO m, MonadCatch m) => m a -> m a
- data WebSocketSimpleError = JSONParseError ByteString
- data WebSocketsAppThreads = WebSocketsAppThreads {
- onOpenThread :: Async ()
- onReceiveThreads :: TChan (Async ())
Documentation
data WebSocketsAppParams send m Source
Generic (WebSocketsAppParams send m) Source | |
type Rep (WebSocketsAppParams send m) Source |
data WebSocketsApp send receive m Source
WebSocketsApp | |
|
Generic (WebSocketsApp send receive m) Source | |
type Rep (WebSocketsApp send receive m) Source |
hoistWebSocketsApp :: (forall a. m a -> n a) -> (forall a. n a -> m a) -> WebSocketsApp send receive m -> WebSocketsApp send receive n Source
toClientAppT :: forall send receive m. (ToJSON send, FromJSON receive, MonadBaseControl IO m, MonadThrow m, MonadCatch m) => WebSocketsApp send receive m -> ClientAppT m (Maybe WebSocketsAppThreads) Source
This can throw a WebSocketSimpleError
when json parsing fails. However, do note:
the onOpen
is called once, but is still forked when called. Likewise, the onReceive
function is called every time a (parsable) response is received from the other party,
and is forked on every invocation.
toClientAppT' :: (ToJSON send, FromJSON receive, MonadBaseControl IO m, MonadThrow m, MonadCatch m) => WebSocketsApp send receive m -> ClientAppT m () Source
toServerAppT :: (ToJSON send, FromJSON receive, MonadBaseControl IO m, MonadThrow m, MonadCatch m) => WebSocketsApp send receive m -> ServerAppT m Source
:: (MonadBaseControl IO m, MonadCatch m) | |
=> m a | The run app |
-> m a |
A simple backoff strategy, which (per second), will increasingly delay at 2^soFar
, until soFar >= 5minutes
, where it will then routinely poll every
5 minutes.
data WebSocketsAppThreads Source
WebSocketsAppThreads | |
|