Portability | unportable |
---|---|
Stability | experimental |
Maintainer | jochem@functor.nl |
Convenience functions and shadowing of API internals.
Likely to be a more stable interface then Control.Hasim.Process
.
- getTime :: Action pkt st Time
- wait :: Time -> Action pkt st ()
- waitForever :: Action pkt st ()
- send :: pkt -> Proc pkt st -> Time -> Action pkt' st' Bool
- trySend :: pkt -> Proc pkt st -> Action pkt' st' Bool
- sendBlock :: pkt -> Proc pkt st -> Action pkt' st' ()
- withAcceptor :: Acceptor pkt st -> Action pkt st () -> Action pkt st ()
- withoutInterruptions :: Action pkt st () -> Action pkt st ()
- receive :: Action pkt st pkt
- poll :: Action pkt st (Maybe pkt)
Time
Waiting
Wait for a nonnegative time period.
waitForever :: Action pkt st ()Source
Wait forever. This can be useful in case you want to block, waiting for incoming packets.
Sending
:: pkt | The packet we send. |
-> Proc pkt st | The receiver process |
-> Time | The timeout. Must be nonnegative. |
-> Action pkt' st' Bool |
Send a packet to a process, with a timeout time interval. Returns True iff the packet was accepted.
Send a packet. Return True iff the packet was accepted immediately. Do not wait in case the packet was not accepted.
Send a packet. Wait as long as necessary to deliver the packet.
Receiving
:: Acceptor pkt st | The acceptor to set |
-> Action pkt st () | The action to be executed |
-> Action pkt st () |
Execute an action with an Acceptor
function