System.Miniplex.Sink
Contents
Description
Asynchronous message broadcasting.
Caveat
This module performs writes on sockets that may be closed at any time,
triggering SIGPIPE signals. It is therefore recommended that you call
at the beginning of your
program.
System.Posix.Signals.installHandler System.Posix.Signals.openEndedPipe
System.Posix.Signals.Ignore Nothing
create :: String -> IO SinkSource
creates a message sink. create tagtag is used to uniquely
identify this sink. The set of allowed characters for tag includes
letters, digits, _, - and +.
(Implementation detail: This function actually creates a named socket
in your ~/.miniplex/.)
write :: Sink -> String -> IO ()Source
asynchronously writes write si msgmsg to si, where it will be
received by all currently connected readers.
destroy :: Sink -> IO ()Source
Deallocates a sink. The destroyed sink must not be used again.
(Implementation detail: This function closes and removes the socket from
the file system. If you forget to call it, you'll leave a stale entry in
~/.miniplex/, which will cause calls to create with the same tag to
fail.)