Copyright | (C) 2016 Yorick Laupa |
---|---|
License | (see the file LICENSE) |
Maintainer | Yorick Laupa <yo.eight@gmail.com> |
Stability | provisional |
Portability | non-portable |
Safe Haskell | None |
Language | Haskell2010 |
This module exposes an implementation of Store for testing purpose. This implementation is threadsafe.
Synopsis
- data Stream = Stream {}
- data StubStore
- newStub :: IO StubStore
- streams :: StubStore -> IO (Map StreamName Stream)
- subscriptionIds :: StubStore -> StreamName -> IO [SubscriptionId]
- lastStreamEvent :: StubStore -> StreamName -> IO (Maybe SavedEvent)
Documentation
Holds stream state data.
Instances
Store StubStore Source # | |
Defined in EventSource.Store.Stub appendEvents :: (EncodeEvent a, MonadBase IO m) => StubStore -> StreamName -> ExpectedVersion -> [a] -> m (Async EventNumber) # readStream :: MonadBase IO m => StubStore -> StreamName -> Batch -> Stream (Of SavedEvent) (ExceptT ReadFailure m) () # subscribe :: MonadBase IO m => StubStore -> StreamName -> m Subscription # |
subscriptionIds :: StubStore -> StreamName -> IO [SubscriptionId] Source #
Returns all subscriptions a stream has.
lastStreamEvent :: StubStore -> StreamName -> IO (Maybe SavedEvent) Source #
Returns the last event of stream.