Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- mailboxes :: IORef (Map MailboxId (EVar SData))
- data MailboxId = (Typeable a, Ord a) => MailboxId a TypeRep
- putMailbox :: Typeable val => val -> TransIO ()
- putMailbox' :: (Typeable key, Ord key, Typeable val) => key -> val -> TransIO ()
- newMailbox :: MailboxId -> TransIO ()
- getMailbox :: Typeable val => TransIO val
- getMailbox' :: (Typeable key, Ord key, Typeable val) => key -> TransIO val
- deleteMailbox :: Typeable a => a -> TransIO ()
- deleteMailbox' :: (Typeable key, Ord key, Typeable a) => key -> a -> TransIO ()
Documentation
putMailbox :: Typeable val => val -> TransIO () Source #
write to the mailbox
Mailboxes are node-wide, for all processes that share the same connection data, that is, are under the
same listen
or connect
while EVars are only visible by the process that initialized it and his children.
Internally, the mailbox is in a well known EVar stored by listen
in the Connection
state.
putMailbox' :: (Typeable key, Ord key, Typeable val) => key -> val -> TransIO () Source #
write to a mailbox identified by an identifier besides the type
newMailbox :: MailboxId -> TransIO () Source #
getMailbox :: Typeable val => TransIO val Source #
get messages from the mailbox that matches with the type expected.
The order of reading is defined by readTChan
This is reactive. it means that each new message trigger the execution of the continuation
each message wake up all the getMailbox
computations waiting for it.
getMailbox' :: (Typeable key, Ord key, Typeable val) => key -> TransIO val Source #
read from a mailbox identified by an identifier besides the type
deleteMailbox :: Typeable a => a -> TransIO () Source #
delete all subscriptions for that mailbox expecting this kind of data