-- Hoogle documentation, generated by Haddock
-- See Hoogle, http://www.haskell.org/hoogle/


-- | An in-memory stub store implementation.
--   
--   An in-memory stub store implementation.
@package eventsource-stub-store
@version 1.0.3


-- | This module exposes an implementation of Store for testing purpose.
--   This implementation is threadsafe.
module EventSource.Store.Stub

-- | Holds stream state data.
data Stream
Stream :: EventNumber -> Seq SavedEvent -> Stream
[streamNumber] :: Stream -> EventNumber
[streamEvents] :: Stream -> Seq SavedEvent
data StubStore

-- | Creates a new stub event store.
newStub :: IO StubStore

-- | Returns current <a>StubStore</a> streams state.
streams :: StubStore -> IO (Map StreamName Stream)

-- | Returns all subscriptions a stream has.
subscriptionIds :: StubStore -> StreamName -> IO [SubscriptionId]

-- | Returns the last event of stream.
lastStreamEvent :: StubStore -> StreamName -> IO (Maybe SavedEvent)
instance EventSource.Store.Store EventSource.Store.Stub.StubStore
