Copyright | (c) Anton Gushcha, 2015-2016 |
---|---|
License | BSD3 |
Maintainer | ncrashed@gmail.com |
Stability | experimental |
Portability | POSIX |
Safe Haskell | None |
Language | Haskell2010 |
- class MonadIO m => SyncMonad m where
- getSyncIdM :: HashableTypeRep -> m (Maybe Word64)
- getSyncTypeRepM :: Word64 -> m (Maybe HashableTypeRep)
- registerSyncIdM :: LoggingMonad m => HashableTypeRep -> m Word64
- addSyncTypeRepM :: LoggingMonad m => HashableTypeRep -> Word64 -> m ()
- syncScheduleMessageM :: (NetworkMonad m, LoggingMonad m, NetworkMessage i, Serialize (NetworkMessageType i)) => Peer -> ChannelID -> i -> MessageType -> NetworkMessageType i -> m ()
- syncSetLoggingM :: Bool -> m ()
- syncSetRoleM :: SyncRole -> m ()
- syncGetRoleM :: m SyncRole
- syncRequestIdM :: forall proxy i. (ActorMonad m, NetworkMonad m, LoggingMonad m, NetworkMessage i) => Peer -> proxy i -> m ()
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 :: 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
:: (NetworkMonad m, LoggingMonad m, NetworkMessage i, Serialize (NetworkMessageType i)) | |
=> Peer | Which peer we sending to |
-> ChannelID | Which channel we are sending within |
-> i | ID of actor |
-> MessageType | Strategy of the message (reliable, unordered etc.) |
-> NetworkMessageType i | Message to send |
-> m () |
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
(MonadIO (mt m), SyncMonad m, ActorMonad m, NetworkMonad m, LoggingMonad m, MonadTrans mt) => SyncMonad (mt m) Source | |
MonadIO m => SyncMonad (SyncT s m) Source |