Skip to content

Commit

Permalink
loadbalancer: Some cleanups for DefaultHost (#2779)
Browse files Browse the repository at this point in the history
Motivation:

DefaultHost has a bunch of state balled up in ConnState
and we end up doing a bunch of unchecked casts. This makes
it tough to read and tough for the compiler to do it's job.

It turns out that we also have some poor life-cycle
management going on so we can tidy that up as well.

Modifications:

Make ConnState an instance class and pull in the type arg C.
Make it's connection array a List. This is because it's
not easy to make an array from generic types which is perhaps
the reason we were using an Object[] in the first place.
Remove the Host.markClosed() method and instead just use
the AsyncClosable close API's. This makes it so the onClose
listeners all hear when the connection is closed, and not just
due to expiration.
  • Loading branch information
bryce-anderson authored Dec 19, 2023
1 parent 5414106 commit e3daaf3
Show file tree
Hide file tree
Showing 4 changed files with 205 additions and 230 deletions.
Loading

0 comments on commit e3daaf3

Please sign in to comment.