akkadotnet / akka.analyzers

Roslyn analyzers for Akka.NET developers.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

AK1000: do not call `IWithTimers.Schedule` inside PreRestart

Aaronontheweb opened this issue · comments

Calling any of the IWithTimers.ScheduleXXX methods will not work inside PreRestart because those timers will immediately be cancelled when the actor restarts, by design. If an actor wants to schedule a message to itself between restarts it should do that using the older methods.

Actually, instead of using the old scheduler methods suggest that the user migrate these calls to PostRestart instead.