public interface OngoingRequest
Modifier and Type | Field and Description |
---|---|
static InetSocketAddress |
PORT_ZERO |
static ServerInfo |
UNKNOWN_SERVER_INFO |
Modifier and Type | Method and Description |
---|---|
default long |
arrivalTimeNanos()
Get the arrival time of the incoming request in nanoseconds.
|
void |
drop()
Drop the request.
|
boolean |
isExpired() |
void |
reply(Response<okio.ByteString> response)
Reply to the request with a
Response . |
Request |
request()
Returns the
Request . |
default ServerInfo |
serverInfo()
Returns an identifier for the server where this request originated.
|
static final InetSocketAddress PORT_ZERO
static final ServerInfo UNKNOWN_SERVER_INFO
default ServerInfo serverInfo()
void reply(Response<okio.ByteString> response)
Response
.response
- Response to send as replyvoid drop()
boolean isExpired()
default long arrivalTimeNanos()
System.nanoTime()
. To get unix epoch
time, do something like:
long processingTimeNanos = System.nanoTime() - requestContext.arrivalTimeNanos();
long arrivalTimeUnixEpochMillis = System.currentTimeMillis() +
TimeUnit.NANOSECONDS.toMillis(processingTimeNanos);
System.nanoTime()
Copyright © 2016. All rights reserved.