Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AK1004 - Add ScheduleTell to IWithTimers analyzer #81

Merged

Conversation

Arkatufus
Copy link
Contributor

Partially Fixes #14

Should we also detect ScheduleOnce() and ScheduleRepeatedly()? These schedules Action to run on the scheduler directly so converting them might change the code behavior.

Designing a fix for this is very complicated, should we spend the engineering time to do this?

Changes

  • Add analyzer that detects uses of ScheduleTellOnce() and ScheduleTellRepeatedly() and suggest to switch to IWithTimers instead.

@Arkatufus Arkatufus marked this pull request as draft March 7, 2024 22:14
# Conflicts:
#	src/Akka.Analyzers/Context/Core/Actor/AkkaCoreActorContext.cs
#	src/Akka.Analyzers/Context/Core/Actor/IAkkaCoreActorContext.cs
@Aaronontheweb
Copy link
Member

Why don't we remove the code fix and just keep the warning / suggestion? That should simplify this.

@Aaronontheweb
Copy link
Member

When we do #84, we'll need to make an exception to this rule.

@Arkatufus Arkatufus marked this pull request as ready for review March 13, 2024 15:06
Copy link
Member

@Aaronontheweb Aaronontheweb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@Aaronontheweb Aaronontheweb merged commit 4ff3a14 into akkadotnet:dev Mar 13, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

AK1000: suggest that actors use IWithTimers and the TimerScheduler API instead of Context.System.Scheduler
2 participants