devsisters / shardcake

Sharding and location transparency for Scala
https://devsisters.github.io/shardcake/
Apache License 2.0
382 stars 29 forks source link

Prevent interrupting/recreating the expiration fiber too often #96

Closed nox213 closed 8 months ago

nox213 commented 8 months ago

If we have a high volume of requests per unit time coming to an single actor, we will experience performance degradation due to having to constantly interrupt and regenerate the expiration fiber. This PR avoids regenerating the fiber each time by storing when the fiber last received a message and calculating how long it should wait from that.