| Copyright | (c) 2016 Michael Walker |
|---|---|
| License | MIT |
| Maintainer | Michael Walker <mike@barrucadu.co.uk> |
| Stability | experimental |
| Portability | OverloadedStrings |
| Safe Haskell | None |
| Language | Haskell2010 |
Network.Pusher.WebSockets.Channel
Description
Functions for subscribing to and querying channels.
- data Channel
- subscribe :: Text -> PusherClient (Maybe Channel)
- unsubscribe :: Channel -> PusherClient ()
- members :: Channel -> PusherClient (HashMap Text Value)
- whoami :: Channel -> PusherClient Value
Documentation
Channel handle: a witness that we joined a channel, and is used to subscribe to events.
If this is used when unsubscribed from a channel, nothing will happen.
subscribe :: Text -> PusherClient (Maybe Channel) Source #
Subscribe to a channel. If the channel name begins with "private-" or "presence-", authorisation is performed automatically.
This returns immediately. You should wait for the
"pusher:subscription_succeeded" event before attempting to use
presence channel functions like members and whoami.
If authorisation fails, this returns Nothing.
unsubscribe :: Channel -> PusherClient () Source #
Unsubscribe from a channel.