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

[ bsd3, library, web ] [ Propose Tags ]

Please see README.md

[Skip to Readme]
Change log CHANGELOG.md
Dependencies base (>=4.7 && <5), bytestring (>=, cereal (>=, containers (>=, deepseq (>=, exceptions (>=, gore-and-ash (>=, gore-and-ash-actor (>=, gore-and-ash-logging (>=, gore-and-ash-network (>=, hashable (>=, mtl (>=2.2.1), text (>=, unordered-containers (>= [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 Sat Nov 19 14:45:25 UTC 2016
Distributions NixOS:
Downloads 793 total (11 in the last 30 days)
Rating (no votes yet) [estimated by rule of succession]
Your Rating
  • λ
  • λ
  • λ
Status Docs uploaded by user
Build status unknown [no reports yet]
Hackage Matrix CI




Maintainer's Corner

For package maintainers and hackage trustees

Readme for gore-and-ash-sync-

[back to package description]


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

The module depends on:


Add following to your stack.yml to packages section:

- location:
    git: https://github.com/Teaspot-Studio/gore-and-ash-sync.git

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