Classes

The following classes are available globally.

  • A bidirectional streaming Grebe call.

    Both sides, the client and the server, send a sequence of messages. The two streams operate independently, so clients and servers can read and write and whatever oder they like: for example, the server could wait to receive all the client messages before writing its responses, or it could alternately read a message then write a message, or some other combination of reads and writes.

    Example usage of GBidirectionalStreamingCall

    Consider the following protobuf definition for a simple echo service. The service defines one bidirectional streaming RPC. You send a stream of messages and it echoes a stream of messages back to you.

    syntax = "proto3";
    
    service EchoService {
        rpc echo (stream EchoRequest) returns (stream EchoResponse);
    }
    
    message EchoRequest {
        string message = 1;
    }
    
    message EchoResponse {
        string message = 1;
    }
    

    You can create a GBidirectionalStreamingCall like this:

    let requests = Publishers.Sequence<[EchoRequest], Error>(
        sequence: [EchoRequest.with { $0.message = "hello"}, EchoRequest.with { $0.message = "world"}]
    ).eraseToAnyPublisher()
    
    GBidirectionalStreamingCall(request: requests, callOptions: callOptions, closure: echo)
    
    See more

    Declaration

    Swift

    public class GBidirectionalStreamingCall<Request, Response> : ICall where Request : Message, Response : Message
  • A client streaming Grebe call.

    The client sends a sequence of request messages to the server. Once the client has finished writing the messages it waits for the server to read them and return its response

    Example usage of GClientStreamingCall

    Consider the following protobuf definition for a simple echo service. The service defines one client streaming RPC. You send a stream of messages and it sends one messages back to you.

    syntax = "proto3";
    
    service EchoService {
        rpc echo (stream EchoRequest) returns (EchoResponse);
    }
    
    message EchoRequest {
        string message = 1;
    }
    
    message EchoResponse {
        string message = 1;
    }
    

    You can create a GClientStreamingCall like this:

    let requests = Publishers.Sequence<[EchoRequest], Error>(
        sequence: [EchoRequest.with { $0.message = "hello"}, EchoRequest.with { $0.message = "world"}]
    ).eraseToAnyPublisher()
    
    GClientStreamingCall(request: requests, callOptions: callOptions, closure: echo)
    
    See more

    Declaration

    Swift

    public class GClientStreamingCall<Request, Response> : ICall where Request : Message, Response : Message
  • A server streaming Grebe call.

    The client sends a request to the server and gets a sequence of response messages back.

    Example usage of GServerStreamingCall

    Consider the following protobuf definition for a simple echo service. The service defines one server streaming RPC. You send one message and it echoes a stream of messages back to you.

    syntax = "proto3";
    
    service EchoService {
        rpc echo (EchoRequest) returns (stream EchoResponse);
    }
    
    message EchoRequest {
        string message = 1;
    }
    
    message EchoResponse {
        string message = 1;
    }
    

    You can create a GServerStreamingCall like this:

    GServerStreamingCall(request: EchoRequest.with { $0.message = "hello"}, closure: echo)
    
    See more

    Declaration

    Swift

    public class GServerStreamingCall<Request, Response> : ICall where Request : Message, Response : Message
  • A unary Grebe call.

    The client sends a single request to the server and gets a single response back, just like a normal function call.

    Example usage of GUnaryCall

    Consider the following protobuf definition for a simple echo service. The service defines one unary RPC. You send one message and it echoes the message back to you.

    syntax = "proto3";
    
    service EchoService {
        rpc echo (EchoRequest) returns (EchoResponse);
    }
    
    message EchoRequest {
        string message = 1;
    }
    
    message EchoResponse {
        string message = 1;
    }
    

    You can create a GUnaryCall like this:

    GUnaryCall(request: EchoRequest.with { $0.message = "hello"}, closure: echo)
    
    See more

    Declaration

    Swift

    public class GUnaryCall<Request, Response> : ICall where Request : Message, Response : Message
  • Implementation of IGClient.

    See more

    Declaration

    Swift

    public class GClient<Client> : IGClient where Client : GRPCClientInitializable