hasim-0.1: Process-Based Discrete Event Simulation librarySource codeContentsIndex
Control.Hasim.Action
Portabilityunportable
Stabilityexperimental
Maintainerjochem@functor.nl
Contents
Time
Waiting
Sending
Receiving
Description
Convenience functions and shadowing of API internals. Likely to be a more stable interface then Control.Hasim.Process.
Synopsis
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
getTime :: Action pkt st TimeSource
Get the current time. The result will be nonnegative.
Waiting
waitSource
::
=> TimeThe time period we wait. Must be nonnegative.
-> Action pkt st ()
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
sendSource
::
=> pktThe packet we send.
-> Proc pkt stThe receiver process
-> TimeThe 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.
trySendSource
::
=> pktThe packet we send
-> Proc pkt stThe receiver process
-> Action pkt' st' Bool
Send a packet. Return True iff the packet was accepted immediately. Do not wait in case the packet was not accepted.
sendBlockSource
::
=> pktThe packet we send
-> Proc pkt stThe receiver process
-> Action pkt' st' ()
Send a packet. Wait as long as necessary to deliver the packet.
Receiving
withAcceptorSource
::
=> Acceptor pkt stThe acceptor to set
-> Action pkt st ()The action to be executed
-> Action pkt st ()
Execute an action with an Acceptor function
withoutInterruptions :: Action pkt st () -> Action pkt st ()Source
Execute an action without interruptions from incoming packets.
receive :: Action pkt st pktSource
Receive a packet. Block until the first packet comes in.
poll :: Action pkt st (Maybe pkt)Source
Receive a packet, non-blocking.
Produced by Haddock version 2.3.0