Skip to content

Commit 87fc8e9

Browse files
author
Adriano Santos
committed
chore: remove unascessary function
1 parent d3c8a03 commit 87fc8e9

File tree

2 files changed

+0
-31
lines changed

2 files changed

+0
-31
lines changed

lib/grpc/stream.ex

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -119,28 +119,6 @@ defmodule GRPC.Stream do
119119
def unary(input, opts \\ []) when is_struct(input),
120120
do: build_grpc_stream([input], Keyword.merge(opts, unary: true))
121121

122-
@doc """
123-
Wraps an existing `Flow` into a `GRPC.Stream` struct.
124-
125-
> Note: `:join_with` is not supported in this mode and will raise an error if passed.
126-
127-
## Parameters
128-
129-
- `flow`: A valid `Flow` pipeline.
130-
131-
## Returns
132-
133-
A `%GRPC.Stream{}` struct wrapping the flow.
134-
"""
135-
@spec from_flow!(Flow.t(), Keyword.t()) :: t()
136-
def from_flow!(%Flow{} = flow, opts \\ []) do
137-
if Keyword.has_key?(opts, :join_with) do
138-
raise ArgumentError, "join_with option is not supported for Flow input"
139-
end
140-
141-
%__MODULE__{flow: flow, options: opts}
142-
end
143-
144122
@doc """
145123
Extracts the internal `Flow` pipeline from a `GRPC.Stream`.
146124

test/grpc/stream_test.exs

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -74,15 +74,6 @@ defmodule GRPC.StreamTest do
7474
result = stream |> GRPC.Stream.map(&(&1 * 2)) |> GRPC.Stream.to_flow() |> Enum.to_list()
7575
assert Enum.sort(result) == [2, 4, 6]
7676
end
77-
78-
test "converts from Flow to GRPC.Stream" do
79-
flow = Flow.from_enumerable([1, 2, 3], max_demand: 1)
80-
stream = GRPC.Stream.from_flow!(flow)
81-
assert %GRPC.Stream{flow: ^flow} = stream
82-
83-
result = stream |> GRPC.Stream.map(&(&1 * 2)) |> GRPC.Stream.to_flow() |> Enum.to_list()
84-
assert Enum.sort(result) == [2, 4, 6]
85-
end
8677
end
8778

8879
describe "ask/3 with pid" do

0 commit comments

Comments
 (0)