syntax = "proto3";

import "empty.proto";
import "messages.proto";

package grpc.testing;

option java_package = "io.quarkus.grpc.blocking";

// Expect implementation to use @Blocking on method with names suffixed with Blocking
service BlockingTestService {
    // Called on event loop
    rpc EmptyCall (grpc.testing.Empty) returns (grpc.testing.Empty);

    // Called on blocking
    rpc EmptyCallBlocking (grpc.testing.Empty) returns (grpc.testing.Empty);

    // The response contains the thread name
    rpc UnaryCall (SimpleRequest) returns (SimpleResponse);
    rpc UnaryCallBlocking (SimpleRequest) returns (SimpleResponse);
    // The response contains the thread name in each item
    rpc StreamingOutputCall (StreamingOutputCallRequest) returns (stream StreamingOutputCallResponse);
    rpc StreamingOutputCallBlocking (StreamingOutputCallRequest) returns (stream StreamingOutputCallResponse);

    // The response contains the thread name
    rpc StreamingInputCall (stream StreamingInputCallRequest) returns (StreamingInputCallResponse);
    rpc StreamingInputCallBlocking (stream StreamingInputCallRequest) returns (StreamingInputCallResponse);

    rpc FullDuplexCall (stream StreamingOutputCallRequest) returns (stream StreamingOutputCallResponse);
    rpc FullDuplexCallBlocking (stream StreamingOutputCallRequest) returns (stream StreamingOutputCallResponse);

    rpc HalfDuplexCall (stream StreamingOutputCallRequest) returns (stream StreamingOutputCallResponse);
    rpc HalfDuplexCallBlocking (stream StreamingOutputCallRequest) returns (stream StreamingOutputCallResponse);

    // The test server will not implement this method. It will be used
    // to test the behavior when clients call unimplemented methods.
    rpc UnimplementedCall (grpc.testing.Empty) returns (grpc.testing.Empty);
    rpc UnimplementedCallBlocking (grpc.testing.Empty) returns (grpc.testing.Empty);
}

