Interface EndpointSelector
- All Known Subinterfaces:
EndpointGroup
- All Known Implementing Classes:
AbstractEndpointSelector
,ConsulEndpointGroup
,DnsAddressEndpointGroup
,DnsServiceEndpointGroup
,DnsTextEndpointGroup
,DynamicEndpointGroup
,Endpoint
,EurekaEndpointGroup
,HealthCheckedEndpointGroup
,PropertiesEndpointGroup
,ZooKeeperEndpointGroup
public interface EndpointSelector
Selects an
Endpoint
from an EndpointGroup
.-
Method Summary
Modifier and TypeMethodDescriptiondefault CompletableFuture<Endpoint>
select
(ClientRequestContext ctx, ScheduledExecutorService executor) Selects anEndpoint
asynchronously from theEndpointGroup
associated with the specifiedClientRequestContext
, waiting up to the specifiedtimeoutMillis
.select
(ClientRequestContext ctx, ScheduledExecutorService executor, long timeoutMillis) Deprecated.
-
Method Details
-
selectNow
- Returns:
- the
Endpoint
selected by thisEndpointSelector
's selection strategy, ornull
if noEndpoint
was selected, which can happen if theEndpointGroup
is empty.
-
select
@Deprecated CompletableFuture<Endpoint> select(ClientRequestContext ctx, ScheduledExecutorService executor, long timeoutMillis) Deprecated.Selects anEndpoint
asynchronously from theEndpointGroup
associated with the specifiedClientRequestContext
, waiting up to the specifiedtimeoutMillis
.- Parameters:
ctx
- theClientRequestContext
of theRequest
being handled.executor
- theScheduledExecutorService
used for notifying theCompletableFuture
being returned and scheduling timeout tasks.timeoutMillis
- the amount of milliseconds to wait until a successfulEndpoint
selection.- Returns:
- the
CompletableFuture
that will be completed with theEndpoint
selected by thisEndpointSelector
's selection strategy, or completed withnull
if noEndpoint
was selected within the specifiedtimeoutMillis
, which can happen if theEndpointGroup
is empty.
-
select
default CompletableFuture<Endpoint> select(ClientRequestContext ctx, ScheduledExecutorService executor) Selects anEndpoint
asynchronously from theEndpointGroup
associated with the specifiedClientRequestContext
, waiting up to the specifiedtimeoutMillis
.- Parameters:
ctx
- theClientRequestContext
of theRequest
being handled.executor
- theScheduledExecutorService
used for notifying theCompletableFuture
being returned and scheduling timeout tasks.- Returns:
- the
CompletableFuture
that will be completed with theEndpoint
selected by thisEndpointSelector
's selection strategy, or completed withnull
if noEndpoint
was selected within the specifiedtimeoutMillis
, which can happen if theEndpointGroup
is empty.
-
select(ClientRequestContext, ScheduledExecutorService)
withEndpointGroup.selectionTimeoutMillis()
.