tonarino / actor

A minimalist actor framework aiming for high performance and simplicity.
MIT License
40 stars 6 forks source link

Fix timed messages for busy actors #73

Closed strohel closed 1 year ago

strohel commented 1 year ago

Add test showcasing delayed messages not delivered to busy actors

This test fails (as of this commit) with

---- timed::tests::recurring_messages_for_busy_actors stdout ----
thread 'timed::tests::recurring_messages_for_busy_actors' panicked at 'assertion failed: `(left == right)`
  left: `[1, 3, 3]`,
 right: `[1, 2, 3, 2, 3]`', src/timed.rs:318:9

I.e. messages of type 2 (delayed) are never delivered.

Process delayed/recurring messages also for busy actors

This fixes the recurring_messages_for_busy_actors test, and should fix #72.


Please give the contained logic thorough review scrutiny, this is a central thing.

strohel commented 1 year ago

I've tested this in https://github.com/tonarino/portal/pull/2293 and it's looking good!

@skywhale (or anybody else) I've changed order of processing slightly, added/extended docs and fixed the typo, PTAL.

Once we merge this I'll do a release.

strohel commented 1 year ago

As an aside, did you notice any change in the speed of the benchmarks?

We unfortunately don't have any benches that used the Timed wrapper (and this change is strictly contained to he timed wrapper).