Skip to content

Commit a40f36c

Browse files
author
Adriano Santos
committed
refactor: rename single to unary
1 parent fcec891 commit a40f36c

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

examples/helloworld_streams/lib/helloworld_streams/server.ex

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ defmodule HelloworldStreams.Server do
1212

1313
@spec say_unary_hello(HelloRequest.t(), GRPC.Server.Stream.t()) :: any()
1414
def say_unary_hello(request, _materializer) do
15-
GRPCStream.single(request)
15+
GRPCStream.unary(request)
1616
|> GRPCStream.ask(Transformer)
1717
|> GRPCStream.map(fn %HelloReply{} = reply ->
1818
%HelloReply{message: "[Reply] #{reply.message}"}
@@ -22,7 +22,7 @@ defmodule HelloworldStreams.Server do
2222

2323
@spec say_server_hello(HelloRequest.t(), GRPC.Server.Stream.t()) :: any()
2424
def say_server_hello(request, materializer) do
25-
GRPCStream.single(request, propagate_context: true, materializer: materializer)
25+
GRPCStream.unary(request, propagate_context: true, materializer: materializer)
2626
# Create new output stream from the request and drop the input
2727
|> GRPCStream.via(fn _metadata, %HelloRequest{} = msg ->
2828
create_output_stream(msg)

lib/grpc/stream.ex

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -115,8 +115,8 @@ defmodule GRPC.Stream do
115115
116116
flow = GRPCStream.single(request, max_demand: 5)
117117
"""
118-
@spec single(any(), Keyword.t()) :: t()
119-
def single(input, opts \\ []) when is_struct(input),
118+
@spec unary(any(), Keyword.t()) :: t()
119+
def unary(input, opts \\ []) when is_struct(input),
120120
do: build_grpc_stream([input], Keyword.merge(opts, unary: true))
121121

122122
@doc """

0 commit comments

Comments
 (0)