Package io.grpc

Interface ServerCallHandler<RequestT,​ResponseT>


  • @ThreadSafe
    public interface ServerCallHandler<RequestT,​ResponseT>
    Interface to initiate processing of incoming remote calls. Advanced applications and generated code will implement this interface to allows Servers to invoke service methods.
    • Method Detail

      • startCall

        ServerCall.Listener<RequestT> startCall​(ServerCall<RequestT,​ResponseT> call,
                                                Metadata headers)
        Produce a non-null listener for the incoming call. Implementations are free to call methods on call before this method has returned.

        Since Metadata is not thread-safe, the caller must not access (read or write) headers after this point.

        If the implementation throws an exception, call will be closed with an error. Implementations must not throw an exception if they started processing that may use call on another thread.

        Parameters:
        call - object for responding to the remote client.
        Returns:
        listener for processing incoming request messages for call