| Copyright | Copyright (c) 2015-2017 David Sorokin <david.sorokin@gmail.com> |
|---|---|
| License | BSD3 |
| Maintainer | David Sorokin <david.sorokin@gmail.com> |
| Stability | experimental |
| Safe Haskell | None |
| Language | Haskell98 |
Simulation.Aivika.Distributed.Optimistic.Guard
Description
Tested with: GHC 8.0.2
This module defines guards that allow correct finishing the distributed simulation.
- runMasterGuard :: (Serializable a, Serializable b) => Int -> (Map ProcessId a -> Event DIO (Map ProcessId b)) -> Process DIO (Map ProcessId b)
- runSlaveGuard :: (Serializable a, Serializable b) => ProcessId -> Event DIO a -> Process DIO (Maybe b)
- runMasterGuard_ :: Int -> Process DIO ()
- runSlaveGuard_ :: ProcessId -> Process DIO ()
Guards With Message Passing
Arguments
| :: (Serializable a, Serializable b) | |
| => Int | the number of slaves to wait |
| -> (Map ProcessId a -> Event DIO (Map ProcessId b)) | how to transform the messages from the slave processes in the stop time |
| -> Process DIO (Map ProcessId b) |
Run the master guard by the specified number of slaves and transform function.
Arguments
| :: (Serializable a, Serializable b) | |
| => ProcessId | the master process identifier |
| -> Event DIO a | in the stop time generate a message to pass to the master process |
| -> Process DIO (Maybe b) | the message returned by the master process |
Run the slave guard by the specified master process identifier and message generator.