-
Notifications
You must be signed in to change notification settings - Fork 1k
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
[routing] Akka.Routing refactoring #2719
Conversation
@@ -153,38 +153,28 @@ public override RouterConfig WithFallback(RouterConfig routerConfig) | |||
|
|||
private RouterConfig OverrideUnsetConfig(RouterConfig other) | |||
{ | |||
if (other is NoRouter) | |||
if (other is Pool pool) |
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.
everything that isn't a Pool
returned this
, so this is the only real check we need. Same with the other routers.
|
||
if (_hashMapping(message) != null) | ||
var hashMapping = _hashMapping(message); |
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.
This delegate was being called twice which should return the same value each time. So I stored it in a variable so it only needed to be called once.
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.
Nice catch
64c8537
to
85335bf
Compare
This PR refactors the classes in the Akka.Routing namespace to take advantage of newer C# features. It also simplifies some of the logic in the various routers.
5c2b556
to
2b2ff41
Compare
looks great @sean-gilliam - love seeing the C#7 features cutting down on code bloat |
switch (obj) | ||
{ | ||
case null: | ||
return new byte[] { 0 }; |
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 don't know the context, and how often this one called and maybe it's super micro, but seems like a constant?
This PR refactors the classes in the Akka.Routing namespace to take advantage of newer C# features. It also simplifies some of the logic in the various routers.
This PR refactors the classes in the Akka.Routing namespace to take
advantage of newer C# features. It also simplifies some of the logic in
the various routers.