Package io.servicetalk.client.api
Interface ServiceDiscoverer<UnresolvedAddress,ResolvedAddress,E extends ServiceDiscovererEvent<ResolvedAddress>>
-
- Type Parameters:
UnresolvedAddress- The type of address before resolution.ResolvedAddress- The type of address after resolution.E- Type ofServiceDiscovererEvents published fromdiscover(Object).
- All Superinterfaces:
AsyncCloseable,ListenableAsyncCloseable
public interface ServiceDiscoverer<UnresolvedAddress,ResolvedAddress,E extends ServiceDiscovererEvent<ResolvedAddress>> extends ListenableAsyncCloseable
Represents the interaction pattern with a service discovery system. It is assumed that oncediscover(Object)is called that the service discovery system will push data updates or implementations of this interface will poll for data updates. Changes in the available hosts will be communicated via the resultingPublisher.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description Publisher<java.util.Collection<E>>discover(UnresolvedAddress address)Subscribe to the service discovery system for changes in the availableServiceDiscovererassociated withaddress.-
Methods inherited from interface io.servicetalk.concurrent.api.AsyncCloseable
closeAsync, closeAsyncGracefully
-
Methods inherited from interface io.servicetalk.concurrent.api.ListenableAsyncCloseable
onClose
-
-
-
-
Method Detail
-
discover
Publisher<java.util.Collection<E>> discover(UnresolvedAddress address)
Subscribe to the service discovery system for changes in the availableServiceDiscovererassociated withaddress.In general a call to this method will continue to discover changes related to
addressuntil thePublisherSource.Subscriptioncorresponding to the return value is cancelled viaCancellable.cancel()or there are no more changes to publish.- Parameters:
address- the service address to discover. Examples of what this address maybe are:- hostname/port (e.g. InetAddress)
- service name
- it may be a list of attributes which describe the service attributes to resolve
- something else
- Returns:
- a
Publisherthat represents a stream of events from the service discovery system.
-
-