-
Notifications
You must be signed in to change notification settings - Fork 141
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Simultaneous timer events #176
Comments
Here is a test: TimerSystem ts = new MillisecondsTimerSystem();
Cell<Long> time = ts.time;
List<Long> out = new ArrayList<>();
Transaction.runVoid(() -> {
Long now = time.sample();
Stream a1 = ts.at(new Cell(Optional.of(now + 100)));
Stream a2 = ts.at(new Cell(Optional.of(now + 100)));
Stream<Long> m = a1.orElse(a2);
m.listen((Long t) -> {
out.add(t);
});
});
try { Thread.sleep(200); } catch (InterruptedException e) {}
assertEquals(1, out.size()); It starts two alarms that should trigger at the same point in time. The stream, produced by merging both alarms, should have only one event. |
Thanks for the test. I have fixed this in the C# and F# versions (but not pushed yet) and will try to take a look at the Java version soon. |
Thanks :) |
This has been fixed in the C# and F# versions. I will leave it open until the Java version is fixed as well. |
# for free
to join this conversation on GitHub.
Already have an account?
# to comment
Hi :)
If I understand it correctly, for each timer event current Java implementation generates a separate transaction, inside
send()
. What if there are multiple events scheduled to the same point in time? Shouldn't theirsend()
s, as well asTimerSystem.time.send()
, be aggregated into a single transaction in order to guarantee coalescence?The text was updated successfully, but these errors were encountered: