Complete send
Closes the sending channel in a client or bidirectional stream
Function CompleteSend(Val Connection, Val StreamID) Export
| Parameter | CLI option | Type | Required | Description |
|---|---|---|---|---|
| Connection | - | Arbitrary | ✔ | Connection object |
| StreamID | - | String | ✔ | Stream Identifier |
Returns: Map Of KeyAndValue - Processing result
caution
NOCLI: this method is not available in CLI version
1C:Enterprise/OneScript code example
Address = "https://grpcb.in:9001";
Proto1 = "https://hut.openintegrations.dev/test_data/grpcbin_with_import.proto"; // String, path to file or URL
Proto2 = "https://hut.openintegrations.dev/test_data/mt.proto"; // String, path to file or URL
Scheme = New Map;
Scheme.Insert("main.proto" , Proto1); // Primary
Scheme.Insert("my_types.proto", Proto2); // For import in primary
Parameters = OPI_GRPC.GetConnectionParameters(Address, Scheme);
Tls = OPI_GRPC.GetTlsSettings(True);
Service = "grpcbin.GRPCBin";
Method = "DummyClientStream";
Connection = OPI_GRPC.CreateConnection(Parameters, Tls);
If Not OPI_GRPC.IsConnector(Connection) Then
Raise Connection["error"];
EndIf;
Result = OPI_GRPC.InitializeClientStream(Connection, Service, Method);
If Not Result["result"] Then
Raise Result["error"];
Else
StreamID = Result["streamId"];
EndIf;
Result = OPI_GRPC.CompleteSend(Connection, StreamID);
Result
{
"result": true
}