Skip to content

Add IWithTimers API with sender override#7341

Merged
Aaronontheweb merged 4 commits into
akkadotnet:devfrom
Arkatufus:Add-IWIthTimers-sender-override
Sep 24, 2024
Merged

Add IWithTimers API with sender override#7341
Aaronontheweb merged 4 commits into
akkadotnet:devfrom
Arkatufus:Add-IWIthTimers-sender-override

Conversation

@Arkatufus

Copy link
Copy Markdown
Contributor

IWithTimers always pass in ActorRefs.Nobody as the scheduler message sender for all timers/

Changes

Add new API methods that allows user to specify the message sender for messages sent by the IWithTimers.Timer

@Arkatufus Arkatufus left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Self-review

Comment on lines +268 to +270
task = _ctx.System.Scheduler.ScheduleTellRepeatedlyCancelable(initialDelay, timeout, _ctx.Self, timerMsg, sender);
else
task = _ctx.System.Scheduler.ScheduleTellOnceCancelable(timeout, _ctx.Self, timerMsg, ActorRefs.NoSender);
task = _ctx.System.Scheduler.ScheduleTellOnceCancelable(timeout, _ctx.Self, timerMsg, sender);

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

The fix, allow the API to specify who the sender is and only use ActorRefs.Nobody if none is specified

@Aaronontheweb Aaronontheweb left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM

@Aaronontheweb Aaronontheweb enabled auto-merge (squash) September 23, 2024 15:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants