eventstore 0.7.0.0 → 0.7.0.1
raw patch · 6 files changed
+38/−18 lines, 6 filesdep ~basedep ~bytestringPVP ok
version bump matches the API change (PVP)
Dependency ranges changed: base, bytestring
API changes (from Hackage documentation)
Files
- CHANGELOG.markdown +5/−0
- Database/EventStore/Internal/Manager/Subscription.hs +8/−7
- Database/EventStore/Internal/Operation/TransactionStartOperation.hs +4/−0
- Database/EventStore/Internal/Operation/WriteEventsOperation.hs +4/−0
- Database/EventStore/Internal/Processor.hs +14/−8
- eventstore.cabal +3/−3
CHANGELOG.markdown view
@@ -1,3 +1,8 @@+0.7.0.1+-------+* Tight package channnel to connection instance in order to prevent loss on connection drops.+* `Connection` has asynchronous operation for real now.+ 0.7.0.0 ------- * Fix date conversion. `recordedEventCreateEpoch` is no longer exposed.
Database/EventStore/Internal/Manager/Subscription.hs view
@@ -32,6 +32,7 @@ import Control.Concurrent import Control.Monad.Fix import Data.ByteString (ByteString)+import Data.Functor import Data.Int import qualified Data.Map.Strict as M import Data.Maybe@@ -269,13 +270,13 @@ mgr_b push_pkg_io = pushAsync push_pkg - push_sub_io cb stream res_lnk_tos = randomIO >>= \uuid -> sync $- push_sub Subscribe- { _subId = uuid- , _subCallback = cb- , _subStream = stream- , _subResolveLinkTos = res_lnk_tos- }+ push_sub_io cb stream res_lnk_tos = randomIO >>= \uuid -> void $+ forkIO $ sync $ push_sub Subscribe+ { _subId = uuid+ , _subCallback = cb+ , _subStream = stream+ , _subResolveLinkTos = res_lnk_tos+ } _ <- listen on_sub (push_pkg_io . createSubscribePackage sett)
Database/EventStore/Internal/Operation/TransactionStartOperation.hs view
@@ -1,3 +1,4 @@+{-# LANGUAGE CPP #-} {-# LANGUAGE RecordWildCards #-} -------------------------------------------------------------------------------- -- |@@ -18,7 +19,10 @@ import Control.Exception import Data.Int import Data.Maybe+#if MIN_VERSION_base(4,8,0)+#else import Data.Traversable+#endif -------------------------------------------------------------------------------- import Control.Concurrent.Async
Database/EventStore/Internal/Operation/WriteEventsOperation.hs view
@@ -1,3 +1,4 @@+{-# LANGUAGE CPP #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE DataKinds #-} --------------------------------------------------------------------------------@@ -18,7 +19,10 @@ import Control.Concurrent import Data.Int import Data.Maybe+#if MIN_VERSION_base(4,8,0)+#else import Data.Traversable+#endif import GHC.Generics (Generic) --------------------------------------------------------------------------------
Database/EventStore/Internal/Processor.hs view
@@ -31,6 +31,7 @@ -------------------------------------------------------------------------------- import Control.Concurrent import Control.Exception+import Data.Functor (void) import Data.Monoid ((<>)) import Data.Typeable import Data.Word@@ -66,7 +67,7 @@ -------------------------------------------------------------------------------- newProcessor :: Settings -> IO Processor-newProcessor sett = sync $ network sett+newProcessor sett = sync . network sett =<< newChan -------------------------------------------------------------------------------- -- Exception@@ -106,8 +107,8 @@ heartbeatRequestCmd = 0x01 ---------------------------------------------------------------------------------network :: Settings -> Reactive Processor-network sett = do+network :: Settings -> Chan Package -> Reactive Processor+network sett chan = do (onConnect, pushConnect) <- newEvent (onConnected, pushConnected) <- newEvent (onCleanup, pushCleanup) <- newEvent@@ -149,6 +150,7 @@ _ <- listen con_snap $ \(ConnectionSnapshot host port) -> connection sett+ chan push_recv_io (push_con_io host port) push_reco_io@@ -158,6 +160,7 @@ _ <- listen reco_snap $ \(ConnectionSnapshot host port) -> connection sett+ chan push_recv_io push_recod_io push_reco_io@@ -172,9 +175,12 @@ let processor = Processor- { processorConnect = \h p -> sync $ pushConnect $ Connect h p- , processorShutdown = sync $ pushCleanup Cleanup- , processorNewOperation = \o -> sync $ push_new_op o+ { processorConnect = \h p -> void $ forkIO $+ sync $ pushConnect $ Connect h p+ , processorShutdown = void $ forkIO $ sync $+ pushCleanup Cleanup+ , processorNewOperation = \o -> void $ forkIO $+ sync $ push_new_op o , processorNewSubcription = push_sub } @@ -203,6 +209,7 @@ -------------------------------------------------------------------------------- connection :: Settings+ -> Chan Package -> (Package -> IO ()) -> (UUID -> IO () -> IO ()) -> IO ()@@ -210,7 +217,7 @@ -> HostName -> Int -> IO ()-connection sett push_pkg push_con push_reco evt_pkg host port = go+connection sett chan push_pkg push_con push_reco evt_pkg host port = go where go = case s_retry sett of@@ -235,7 +242,6 @@ hSetBuffering hdl NoBuffering uuid <- randomIO- chan <- newChan as_rl <- async $ sync $ listen evt_pkg (writeChan chan) rid <- forkFinally (readerThread push_pkg hdl) (recovering push_reco) wid <- forkFinally (writerThread chan hdl) (recovering push_reco)
eventstore.cabal view
@@ -10,7 +10,7 @@ -- PVP summary: +-+------- breaking API changes -- | | +----- non-breaking API additions -- | | | +--- code changes with no API change-version: 0.7.0.0+version: 0.7.0.1 -- A short (one-line) description of the package. synopsis: EventStore TCP Client@@ -77,10 +77,10 @@ -- other-extensions: -- Other library packages from which modules are imported.- build-depends: base >=4.7 && <4.8+ build-depends: base >=4.7 && <5 , aeson >=0.8 && <0.9 , async >=2.0 && <2.1- , bytestring >=0.10.4 && <0.10.5+ , bytestring >=0.10.4 && <0.11 , cereal >=0.4 && <0.5 , containers >=0.5 && <0.6 , network ==2.6.*