Esc

send

procedureextensionsince 0.36.1Source
  • macOS: send works on macOS
  • Linux: send works on Linux
  • Windows: send works on Windows
  • Wasm: send works on Wasm

Encodes a generated Protobuf value and sends it through the shared framing path. .

Signature

send :: (call: *Call, message: $T, options := Send_Options.{}) -> Status
Example
Api :: #import "Extensions/Protobuf/Schema"(GRPC = true, TEXT = "syntax='proto3'; package echo; message Say { string text = 1; }");

main :: () {
    channel: Channel;
    call, status := open_call(*channel, Method.{ path = "/echo.Echo/Say" });
    defer close(*call);
    status = send(*call, Api.echo.Say.{ text = "hi" });
    assert(status.code == .OK);
}

See also