public interface Service extends Stateful<ServiceState>
Note that while this interface has been around since the 1.x days, it has been changed up quite a bit to make it simpler and provide more functionality based on real world experience with the first iteration.
Modifier and Type | Method and Description |
---|---|
void |
connect()
Instruct this
Service to connect. |
ServiceContext |
context()
Returns the underlying contextual metadata for this service.
|
Stream<EndpointDiagnostics> |
diagnostics()
Returns diagnostics information for this service.
|
void |
disconnect()
Instruct this
Service to disconnect. |
<R extends Request<? extends Response>> |
send(R request)
Sends the request into this
Service . |
ServiceType |
type()
Represents the service type for this service.
|
void connect()
Service
to connect.
This method is async and will return immediately. Use the other methods available to inspect the current state of the service, signaling potential successful connection attempts.
void disconnect()
Service
to disconnect.
This method is async and will return immediately. Use the other methods available to inspect the current state of the service, signaling potential successful disconnection attempts.
<R extends Request<? extends Response>> void send(R request)
Service
.
Note that there is no guarantee that the request will actually dispatched, based on the state this service is in.
request
- the request to send.ServiceContext context()
ServiceType type()
Stream<EndpointDiagnostics> diagnostics()
Copyright © 2020 Couchbase, Inc.. All rights reserved.