module Proteome.Save where import Conc (Lock) import Ribosome (Reports, Handler, LogReport, PersistError, Rpc, RpcError, SettingError, Settings, resumeReport) import Ribosome.Effect.Persist (Persist) import Proteome.Data.Env (Env) import Proteome.Data.PersistBuffers (PersistBuffers) import Proteome.PersistBuffers (StoreBuffersLock, storeBuffers) import Proteome.Tags.Gen (TagsLock, proGenTags) proSave :: Member (Persist PersistBuffers !! PersistError) r => Members [Settings !! SettingError, AtomicState Env, Lock @@ TagsLock, DataLog LogReport] r => Members [Lock @@ StoreBuffersLock, AtomicState Env, Rpc !! RpcError, Reports, Resource, Log, Async, Embed IO] r => Handler r () proSave :: forall (r :: EffectRow). (Member (Persist PersistBuffers !! PersistError) r, Members '[Settings !! SettingError, AtomicState Env, Lock @@ TagsLock, DataLog LogReport] r, Members '[Lock @@ StoreBuffersLock, AtomicState Env, Rpc !! RpcError, Reports, Resource, Log, Async, Embed IO] r) => Handler r () proSave = do Handler r () forall (r :: EffectRow). (Members '[AtomicState Env, Settings !! SettingError, DataLog LogReport, Lock @@ TagsLock, Reports] r, Members '[Log, Resource, Async, Embed IO] r) => Handler r () proGenTags forall (eff :: (* -> *) -> * -> *) e (r :: EffectRow) a. (Reportable e, Members '[eff !! e, Stop Report] r) => Sem (eff : r) a -> Sem r a resumeReport @Rpc (Sem (Rpc : Stop Report : r) () -> Handler r ()) -> Sem (Rpc : Stop Report : r) () -> Handler r () forall a b. (a -> b) -> a -> b $ forall (eff :: (* -> *) -> * -> *) e (r :: EffectRow) a. (Reportable e, Members '[eff !! e, Stop Report] r) => Sem (eff : r) a -> Sem r a resumeReport @(Persist _) (Sem (Persist PersistBuffers : Rpc : Stop Report : r) () -> Sem (Rpc : Stop Report : r) ()) -> Sem (Persist PersistBuffers : Rpc : Stop Report : r) () -> Sem (Rpc : Stop Report : r) () forall a b. (a -> b) -> a -> b $ Sem (Persist PersistBuffers : Rpc : Stop Report : r) () forall (r :: EffectRow). (Member (Persist PersistBuffers) r, Members '[Lock @@ StoreBuffersLock, AtomicState Env, Rpc, Rpc !! RpcError, Resource, Embed IO] r) => Sem r () storeBuffers