Safe Haskell | None |
---|
WebSockets API for Haste.
- module Haste.Concurrent
- data WebSocket
- withWebSocket :: URL -> (WebSocket -> JSString -> CIO ()) -> CIO a -> (WebSocket -> CIO a) -> CIO a
- withBinaryWebSocket :: URL -> (WebSocket -> Blob -> CIO ()) -> CIO a -> (WebSocket -> CIO a) -> CIO a
- wsSend :: WebSocket -> JSString -> CIO ()
- wsSendBlob :: WebSocket -> Blob -> CIO ()
Documentation
module Haste.Concurrent
:: URL | URL to bind the WebSocket to |
-> (WebSocket -> JSString -> CIO ()) | Computation to run when new data arrives |
-> CIO a | Computation to run when an error occurs |
-> (WebSocket -> CIO a) | Computation using the WebSocket |
-> CIO a |
Run a computation with a web socket. The computation will not be executed until a connection to the server has been established.
:: URL | URL to bind the WebSocket to |
-> (WebSocket -> Blob -> CIO ()) | Computation to run when new data arrives |
-> CIO a | Computation to run when an error occurs |
-> (WebSocket -> CIO a) | Computation using the WebSocket |
-> CIO a |
Run a computation with a web socket. The computation will not be executed until a connection to the server has been established.
wsSendBlob :: WebSocket -> Blob -> CIO ()Source
Send a Blob over a WebSocket.