dnvriend / akka-persistence-inmemory

Akka-persistence-inmemory is a plugin for akka-persistence that stores journal and snapshot messages memory, which is very useful when testing persistent actors, persistent FSM and akka cluster
Apache License 2.0
134 stars 41 forks source link

Should not use scheduler with repeat-delay=0 #43

Closed synox closed 6 years ago

synox commented 7 years ago

In InMemoryReadJournal there is a repeat with zero delay:
Source.tick(refreshInterval, 0.seconds, 0)

Why is zero used as repeat delay? Using 10 Miliseconds would solve the problem with the following combination:

When using https://github.com/miguno/akka-mock-scheduler this causes a infinite loop. The Problem is an implementation detail, that results in an endless-loop when using repeat-delay=zero. (See https://github.com/miguno/akka-mock-scheduler/blob/develop/src/main/scala/com/miguno/akka/testing/MockScheduler.scala#L33)

dnvriend commented 6 years ago

Thanks, for the info!