OptionalonA callback to be called when the server call is canceled.
An AbortSignal. The abort event is invoked when the method got canceled.
The deadline for the server call.
Represents the time by which the server call must be completed.
Returns null if no deadline is set.
Returns whether this RPC failed before the server could provide its status to the client.
true if the RPC was canceled, otherwise false.
Adds a key-value pair to the headers associated with a server response call.
The key for the header. If it is a binary value, it must end with "-bin". If it is an ASCII value, it must not end with "-bin".
The value for the header, which can be a string or a Buffer.
Adds a key-value pair to the trailing headers associated with a server call.
The key for the headers.
The value for the headers, which can be a string or a Buffer.
Gets the deadline for the client call as a number representing ms since the epoch.
The deadline as a Date object, or null if no deadline is set.
Cancel the Call from the server.
This is a best-effort API and depending on when it is called, the RPC may still appear successful to the client. For example, if tryCancel() is called on a separate thread, it might race with the server handler which might return success to the client before tryCancel() was even started by the thread.
It is the caller's responsibility to prevent such races and ensure that if tryCancel() is called, the service implementation must return Status::CANCELED. The only exception is that if the service implementation is already returning an error status code, it is ok to not return Status::CANCELED even if tryCancel() was called.
For reasons such as the above, it is generally preferred to explicitly finish an RPC by returning Status::CANCELED rather then using tryCancel.
Interface representing the context of a server-side call.