-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Add ActorBase lifecycle flow unit tests
#7128
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
Add ActorBase lifecycle flow unit tests
#7128
Conversation
Aaronontheweb
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
need to make the read operation zero-allocation.
| /// <summary> | ||
| /// Retrieves all current active timer keys | ||
| /// </summary> | ||
| public ImmutableArray<object> ActiveTimers => _timers.Keys.ToImmutableArray(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would just return an ICollection<object> or whatever here so we don't have to allocate an immutable array each time.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I understand that this is probably done for the purposes of making sure we don't get rugged by the collection changing out from under us, but it's better to take that risk and leave the API un-opionated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done, though accessing _timers.Keys actually allocates internally inside the Dictionary, but that's unavoidable.
…rkatufus/akka.net into Add_ActorBase_Lifecycle_flow_assertion
Aaronontheweb
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Changes
ActiveTimerstoITimerSchedulerto retrieve all currently active timer keysActorBaselifecycle flow unit tests in relation toIWithTimerslifecycleChecklist
For significant changes, please ensure that the following have been completed (delete if not relevant):