Skip to content

Commit

Permalink
Merge pull request pjvds#79 from matt-sullivan/event-store-fix
Browse files Browse the repository at this point in the history
Fix InMemoryBufferedBrowsableElementStore incorrectly discarding events
  • Loading branch information
pjvds committed Oct 12, 2011
2 parents d90bcb7 + bb725d6 commit ed26668
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,11 @@ private IEnumerable<IProcessingElement> FetchFromBuffer()

private IEnumerable<IProcessingElement> FetchFromPersistentStoreAndCorrelateWithBuffer(string pipelineName)
{
var fetchedFromPersistentStore = _persistentStore.Fetch(pipelineName, _fetchSize);
// We need to copy the fetched items to prevent fetchedFromPersistentStore.Any()
// and/or CorrelateWithBufffer consuming events and not returning them.
// Rx extensions MemoizeAll would be a good solution, but I'm not sure we want
// an extra dependency, ToList is fine as long as _fetchSize is reasonable.
var fetchedFromPersistentStore = _persistentStore.Fetch(pipelineName, _fetchSize).ToList();
if (!fetchedFromPersistentStore.Any() || CorrelateWithBufffer(fetchedFromPersistentStore))
{
_inMemoryMode = true;
Expand Down

0 comments on commit ed26668

Please sign in to comment.