Copyright | (c) Anton Gushcha, 2015-2016 |
---|---|
License | BSD3 |
Maintainer | ncrashed@gmail.com |
Stability | experimental |
Portability | POSIX |
Safe Haskell | None |
Language | Haskell2010 |
Documentation
class MonadIO m => SyncMonad m where Source #
Low level API for module Need at least one network channel to operate. If you open more than one channel, the module would use chanel id 1 as service channel, therefore count of channels on client and server should match (server won't response on channel 1 if it doesn't have it).
getSyncIdM, getSyncTypeRepM, registerSyncIdM, addSyncTypeRepM, syncScheduleMessageM, syncSetLoggingM, syncSetRoleM, syncGetRoleM, syncRequestIdM
getSyncIdM :: HashableTypeRep -> m (Maybe Word64) Source #
Find actor id by it stable type representation
getSyncTypeRepM :: Word64 -> m (Maybe HashableTypeRep) Source #
Find actor type representation by it id
registerSyncIdM :: LoggingMonad m => HashableTypeRep -> m Word64 Source #
Generate and register new id for given actor type representation
addSyncTypeRepM :: LoggingMonad m => HashableTypeRep -> Word64 -> m () Source #
Register new type rep with given id, doesn't overide existing records
syncScheduleMessageM :: (NetworkMonad m, LoggingMonad m, NetworkMessage i, Serialize (NetworkMessageType i)) => Peer -> ChannelID -> i -> MessageType -> NetworkMessageType i -> m () Source #
Send message as soon as network id of actor is resolved
syncSetLoggingM :: Bool -> m () Source #
Switch on/off detailed logging of the module
syncSetRoleM :: SyncRole -> m () Source #
Setups behavior model in synchronizing of actor ids Note: clients should be slaves and server master
syncGetRoleM :: m SyncRole Source #
Returns current behavior model in synchronizing of actor ids Note: clients should be slaves and server master
syncRequestIdM :: forall proxy i. (ActorMonad m, NetworkMonad m, LoggingMonad m, NetworkMessage i) => Peer -> proxy i -> m () Source #
Send request for given peer for id of given actor