Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
loadbalancer: Some cleanups for DefaultHost (#2779)
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