Skip to content

Commit 073d960

Browse files
author
Adriano Santos
committed
Merge remote-tracking branch 'upstream/master'
2 parents 2e8cddb + 1db9d1e commit 073d960

File tree

4 files changed

+6
-6
lines changed

4 files changed

+6
-6
lines changed

lib/grpc/client/adapter.ex

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ defmodule GRPC.Client.Adapter do
1414

1515
@callback disconnect(channel :: Channel.t()) :: {:ok, Channel.t()} | {:error, any()}
1616

17-
@callback send_request(stream :: Stream.t(), contents :: binary(), opts :: keyword()) ::
17+
@callback send_request(stream :: Stream.t(), contents :: iodata(), opts :: keyword()) ::
1818
Stream.t()
1919

2020
@doc """
@@ -36,7 +36,7 @@ defmodule GRPC.Client.Adapter do
3636
Opts:
3737
- :send_end_stream (optional) - ends the request stream
3838
"""
39-
@callback send_data(stream :: Stream.t(), message :: binary(), opts :: keyword()) :: Stream.t()
39+
@callback send_data(stream :: Stream.t(), message :: iodata(), opts :: keyword()) :: Stream.t()
4040

4141
@doc """
4242
Similarly to the option sent on `send_data/2` - :send_end_stream -

lib/grpc/codec.ex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ defmodule GRPC.Codec do
55

66
@doc ~s(Name is identity of the codec, which will be suffix after content-type "application/grpc+" such as "proto".)
77
@callback name() :: String.t()
8-
@callback encode(any) :: binary
8+
@callback encode(any) :: iodata()
99
@callback decode(any, module :: atom) :: any
1010

1111
@doc """

lib/grpc/codec/proto.ex

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ defmodule GRPC.Codec.Proto do
55
"proto"
66
end
77

8-
def encode(%mod{} = struct) do
9-
mod.encode(struct)
8+
def encode(struct) do
9+
Protobuf.Encoder.encode_to_iodata(struct)
1010
end
1111

1212
def decode(binary, module) do

lib/grpc/compressor.ex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
defmodule GRPC.Compressor do
22
@callback name() :: String.t()
3-
@callback compress(binary) :: binary
3+
@callback compress(iodata()) :: binary
44
@callback decompress(binary) :: binary
55
end

0 commit comments

Comments
 (0)