You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
<!-- Please use this template for your pull request. -->
<!-- Please use the sections that you need and delete other sections -->
## This PR
<!-- add the description of the PR here -->
This pull request to `src/OpenFeature/EventExecutor.cs` includes changes
to improve code readability and performance. The most important changes
include replacing `List` and `Dictionary` initializations with shorthand
syntax, switching from `Thread` to `Task` for asynchronous operations,
and refactoring methods for better clarity and maintainability.
Improvements to code readability and performance:
*
[`src/OpenFeature/EventExecutor.cs`](diffhunk://#diff-f563baadcf750bb66efaea76d7ec4783320e6efdc45c468effb531c948a2292cL13-R28):
Replaced `List` and `Dictionary` initializations with shorthand syntax
`[]`.
[[1]](diffhunk://#diff-f563baadcf750bb66efaea76d7ec4783320e6efdc45c468effb531c948a2292cL13-R28)
[[2]](diffhunk://#diff-f563baadcf750bb66efaea76d7ec4783320e6efdc45c468effb531c948a2292cL45-R41)
[[3]](diffhunk://#diff-f563baadcf750bb66efaea76d7ec4783320e6efdc45c468effb531c948a2292cL73-R75)
*
[`src/OpenFeature/EventExecutor.cs`](diffhunk://#diff-f563baadcf750bb66efaea76d7ec4783320e6efdc45c468effb531c948a2292cL149-R144):
Changed from using `Thread` to `Task` for asynchronous operations to
improve performance and simplify the code.
[[1]](diffhunk://#diff-f563baadcf750bb66efaea76d7ec4783320e6efdc45c468effb531c948a2292cL149-R144)
[[2]](diffhunk://#diff-f563baadcf750bb66efaea76d7ec4783320e6efdc45c468effb531c948a2292cL219-R213)
[[3]](diffhunk://#diff-f563baadcf750bb66efaea76d7ec4783320e6efdc45c468effb531c948a2292cL237-R257)
Refactoring for better clarity and maintainability:
*
[`src/OpenFeature/EventExecutor.cs`](diffhunk://#diff-f563baadcf750bb66efaea76d7ec4783320e6efdc45c468effb531c948a2292cL189-L204):
Refactored `EmitOnRegistration` method to use a switch expression for
setting the message based on provider status and event type, improving
readability.
*
[`src/OpenFeature/EventExecutor.cs`](diffhunk://#diff-f563baadcf750bb66efaea76d7ec4783320e6efdc45c468effb531c948a2292cR266-R275):
Split `ProcessEventAsync` method into smaller methods
(`ProcessApiHandlers`, `ProcessClientHandlers`,
`ProcessDefaultProviderHandlers`) for better organization and
maintainability.
[[1]](diffhunk://#diff-f563baadcf750bb66efaea76d7ec4783320e6efdc45c468effb531c948a2292cR266-R275)
[[2]](diffhunk://#diff-f563baadcf750bb66efaea76d7ec4783320e6efdc45c468effb531c948a2292cL281-R298)
[[3]](diffhunk://#diff-f563baadcf750bb66efaea76d7ec4783320e6efdc45c468effb531c948a2292cL305-R311)
*
[`src/OpenFeature/EventExecutor.cs`](diffhunk://#diff-f563baadcf750bb66efaea76d7ec4783320e6efdc45c468effb531c948a2292cL219-R213):
Converted `ProcessFeatureProviderEventsAsync` and `ProcessEventAsync`
from `void` to `Task` to follow best practices for asynchronous methods.
[[1]](diffhunk://#diff-f563baadcf750bb66efaea76d7ec4783320e6efdc45c468effb531c948a2292cL219-R213)
[[2]](diffhunk://#diff-f563baadcf750bb66efaea76d7ec4783320e6efdc45c468effb531c948a2292cL237-R257)
### Related Issues
<!-- add here the GitHub issue that this PR resolves if applicable -->
Reference #358
---------
Signed-off-by: André Silva <[email protected]>
0 commit comments