gore-and-ash-sync: Gore&Ash module for high level network synchronization

[ bsd3, library, web ] [ Propose Tags ] [ Report a vulnerability ]
Versions [RSS] 1.1.0.0, 1.1.1.0, 1.2.0.0, 1.2.0.1
Change log CHANGELOG.md
Dependencies base (>=4.7 && <5), bytestring (>=0.10.6.0), cereal (>=0.4.1.1), containers (>=0.5.6.2), deepseq (>=1.4.1.1), exceptions (>=0.8.0.2), gore-and-ash (>=1.1.0.0), gore-and-ash-actor (>=1.1.0.0), gore-and-ash-logging (>=2.0.0.0), gore-and-ash-network (>=1.4.0.0), hashable (>=1.2.3.3), mtl (>=2.2.1), text (>=1.2.2.0), unordered-containers (>=0.2.5.1) [details]
License BSD-3-Clause
Copyright 2016 Anton Gushcha
Author Anton Gushcha
Maintainer ncrashed@gmail.com
Category Web
Home page https://github.com/Teaspot-Studio/gore-and-ash-sync
Uploaded by NCrashed at 2016-11-19T14:45:25Z
Distributions
Downloads 2848 total (16 in the last 30 days)
Rating (no votes yet) [estimated by Bayesian average]
Your Rating
  • λ
  • λ
  • λ
Status Docs uploaded by user
Build status unknown [no reports yet]

Readme for gore-and-ash-sync-1.2.0.1

[back to package description]

gore-and-ash-sync

The module provides facilities of high level synchronizing for Gore&Ash engine.

The module depends on:

Installing

Add following to your stack.yml to packages section:

- location:
    git: https://github.com/Teaspot-Studio/gore-and-ash-sync.git
    commit: <PLACE HERE FULL HASH OF LAST COMMIT> 

When defining you application stack, add SyncT:

type AppStack = ModuleStack [LoggingT, ActorT, NetworkT, SyncT, ... other modules ... ] IO

Unfortunately deriving for SyncMonad isn't work (bug of GHC 7.10.3), so you need meddle with some boilerplate while defining SyncMonad instance for your application monad wrapper:

newtype AppMonad a = AppMonad (AppStack a)
  deriving (Functor, Applicative, Monad, MonadFix, MonadIO, MonadThrow, MonadCatch LoggingMonad, NetworkMonad)

instance SyncMonad AppMonad where 
  getSyncIdM = AppMonad . getSyncIdM
  getSyncTypeRepM = AppMonad . getSyncTypeRepM
  registerSyncIdM = AppMonad . registerSyncIdM
  addSyncTypeRepM a b = AppMonad $ addSyncTypeRepM a b
  syncScheduleMessageM peer ch i mt msg  = AppMonad $ syncScheduleMessageM peer ch i mt msg
  syncSetLoggingM = AppMonad . syncSetLoggingM
  syncSetRoleM = AppMonad . syncSetRoleM
  syncGetRoleM = AppMonad syncGetRoleM
  syncRequestIdM a b = AppMonad $ syncRequestIdM a b