Interface SubchannelPool
- All Known Implementing Classes:
CachedSubchannelPool
@NotThreadSafe
interface SubchannelPool
Manages life-cycle of Subchannels for
GrpclbState.
All methods are run from the ChannelExecutor that the helper uses.
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interfaceReceives state changes for a pooledLoadBalancer.Subchannel. -
Method Summary
Modifier and TypeMethodDescriptionvoidclear()Shuts down all subchannels in the pool immediately.voidRegisters a listener to received Subchannel status updates.voidreturnSubchannel(LoadBalancer.Subchannel subchannel, ConnectivityStateInfo lastKnownState) Puts aLoadBalancer.Subchannelback to the pool.takeOrCreateSubchannel(EquivalentAddressGroup eag, Attributes defaultAttributes) Takes aLoadBalancer.Subchannelfrom the pool for the giveneagif there is one available.
-
Method Details
-
registerListener
Registers a listener to received Subchannel status updates. -
takeOrCreateSubchannel
LoadBalancer.Subchannel takeOrCreateSubchannel(EquivalentAddressGroup eag, Attributes defaultAttributes) Takes aLoadBalancer.Subchannelfrom the pool for the giveneagif there is one available. Otherwise, creates and returns a newSubchannelwith the giveneaganddefaultAttributes. -
returnSubchannel
Puts aLoadBalancer.Subchannelback to the pool. From this point the Subchannel is owned by the pool, and the caller should stop referencing to this Subchannel. -
clear
void clear()Shuts down all subchannels in the pool immediately.
-