Safe Haskell | None |
---|---|
Language | Haskell98 |
Simple bindings to libzephyr.
All functions in this module properly serialize access to the C
libzephyr and behave correctly with regard to forkIO
, so this
module should behave properly in threaded Haskell program.
At present, however, we only support maintaining a single, global, set of Zephyr subscriptions. This may be extended to support multiple clients within the same Haskell program.
- initialize :: IO ()
- getSender :: IO String
- getRealm :: IO String
- sendNotice :: ZNotice -> IO ()
- receiveNotice :: IO ZNotice
- pendingNotices :: IO Int
- tryReceiveNotice :: IO (Maybe ZNotice)
- cancelSubscriptions :: IO ()
- subscribeTo :: [ZSubscription] -> IO ()
- unsubscribeTo :: [ZSubscription] -> IO ()
- defaultFmt :: ByteString
- emptyNotice :: ZNotice
- data ZNotice = ZNotice {}
- newtype ZNoticeKind = ZNoticeKind {}
- data ZAuth
- data ZSubscription = ZSubscription {}
- kind_unsafe :: ZNoticeKind
- kind_unacked :: ZNoticeKind
- kind_acked :: ZNoticeKind
- kind_hmack :: ZNoticeKind
- kind_hmctl :: ZNoticeKind
- kind_servack :: ZNoticeKind
- kind_servnak :: ZNoticeKind
- kind_clientack :: ZNoticeKind
- kind_stat :: ZNoticeKind
Documentation
initialize :: IO () Source #
Initialize libzephyr.
receiveNotice :: IO ZNotice Source #
Receive a ZNotice
from the zephyr servers. Blocks until a
notice is available.
pendingNotices :: IO Int Source #
Checks for new incoming packets and then returns the number of pending messages in the queue.
tryReceiveNotice :: IO (Maybe ZNotice) Source #
Try to receive a ZNotice, returning Nothing
if no notice is
available.
cancelSubscriptions :: IO () Source #
Cancel all zephyr subscriptions.
subscribeTo :: [ZSubscription] -> IO () Source #
Subscribe to one or more Zephyr triples.
unsubscribeTo :: [ZSubscription] -> IO () Source #
Unsubscribe from one or more Zephyr triples.
defaultFmt :: ByteString Source #
Holds the default display format used by outgoing Zephyrs by
zwrite
.
emptyNotice :: ZNotice Source #
A default ZNotice
suitable for use as a template when creating
a new notice for sending via sendNotice
.
ZNotice
represents a Zephyr notice. All fields of this record
are filled-in for received notices. For outoing notices, only
the following fields are relevant:
z_class
z_instance
z_opcode
z_sender
z_default_fmt
z_kind
z_auth
z_fields
ZNotice | |
|
newtype ZNoticeKind Source #
ZNoticeKind
represent the kinds of ZNotice
s sent or received
by the Zephyr system.
Authenticated | The message was received with correct authentication, or should be authenticated for outgoing notices. |
Unauthenticated | The message was or will be sent with no authentication. |
AuthenticationFailed | The message was received with invalid authentication. |
data ZSubscription Source #
Represents a Zephyr triple for the purposes of subscribing or unsubscribing to zephyrs.
kind_servnak :: ZNoticeKind Source #
ZAuth
represents the authentication used when sending or
receiving a Zephyr.