pusher-ws-0.1.1.0: Implementation of the Pusher WebSocket protocol

Copyright(c) 2016 Michael Walker
LicenseMIT
MaintainerMichael Walker <mike@barrucadu.co.uk>
Stabilityexperimental
PortabilityOverloadedStrings
Safe HaskellNone
LanguageHaskell2010

Network.Pusher.WebSockets.Channel

Description

Functions for subscribing to and querying channels.

Synopsis

Documentation

data Channel Source #

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.

members :: Channel -> PusherClient (HashMap Text Value) Source #

Return the list of all members in a presence channel.

If we have unsubscribed from this channel, or it is not a presence channel, returns an empty map.

whoami :: Channel -> PusherClient Value Source #

Return information about the local user in a presence channel.

If we have unsubscribed from this channel, or it is not a presence channel, returns Null.