Tesla.Multipart.assert_part_value! doesn't allow valid stream
@spec assert_part_value!(any) :: :ok | no_return
defp assert_part_value!(%maybe_stream{})
when maybe_stream in [IO.Stream, File.Stream, Stream],
do: :ok
The assert_part_value! function checks if the argument is a stream, but it only allows a subset of the valid streams. There is no restriction on what data type could be used to represent a stream
iex(1)> enum = 1001..9999
iex(2)> n = 3
iex(3)> stream = Stream.transform(1001..9999, 0, fn i, acc ->
...(3)> if acc < n, do: {[i], acc + 1}, else: {:halt, acc}
...(3)> end)
#Function<60.29975488/2 in Stream.transform/3>
In the example above, stream is represented via a function. https://elixirforum.com/t/how-to-check-if-an-argument-is-a-stream-or-stream-like-function/50622
@teamon focusing on other stuff right now, I haven't touch anything related to streaming, any thoughts here?
I see two options here: allow functions in assert_part_value or... remove the validation. We probably should do the former first.
Are you able to pick this one up? Trying to focus in other parts right now