Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make in-memory :any work without explict locks
Guarantees When there are many threads (or processes) writing concurrently (at the same time) to a stream with expected_version set to :any, all of those writes should succeed. When you later try to read those events you from a stream, you don't have a guarantee about particular order you are going to get them in. Example: If 3 processes A,B,C publish events to stream foo-1 at the same time, all of them should succeed. When you read events from stream foo-1 you will get events A,B,C or A,C,B or B,A,C or B,C,A or C,A,B or C,B,A. Should never fail When a single thread (or process) writes events A, B to a stream, it is guaranteed you will retrieve events A,B in that exact order when reading from a stream. as in http://railseventstore.org/docs/expected_version/ We use lock (mutex) under the hood but that's not an issue. SQL DBs also somewhere deep down might use locks to when updating (uniq) indexes (which ActiveRecordRepository used). So this more closely resembles production behavior of :any Refs: #188
- Loading branch information