Task.async_stream elixir 返回奇怪的输出

Jac*_*sle 5 asynchronous elixir phoenix-framework

在我将许多文件上传到 S3 时,使用 Task.async_stream 效果很好。

\n\n

尝试在 download_many 函数中使用它,该函数采用 url 和 id 的关键字列表。当我在 iex 会话中运行 download_many 函数时,它返回以下输出:

\n\n
iex(1)> Karma.S3.download_many(1)\n    #Function<1.112846234/2 in Task.build_stream/3>\n    #Function<1.112846234/2 in Task.build_stream/3>\n
Run Code Online (Sandbox Code Playgroud)\n\n

这是函数:

\n\n
def download_many(_urls) do\n    urls = [\n      \xe2\x80\x9c5\xe2\x80\x9d: \xe2\x80\x9chttps://engine-image-uploads.s3.amazonaws.com/engine-image-uploads/d4a9f8adb58b4e0b83c47e8f3b21d421-fillable.pdf\xe2\x80\x9c,\n      \xe2\x80\x9c3\xe2\x80\x9d: \xe2\x80\x9chttps://engine-image-uploads.s3.amazonaws.com/engine-image-uploads/ccd6d66cb4304b369a025efe3b26e68b-fillable.pdf\xe2\x80\x9d\n    ]\n\n   ops = [max_concurrency: System.schedulers_online() * 3, timeout: 20000]\n\n   tasks = Task.async_stream(urls, &download_with_id/1, ops)\n    |> Enum.to_list()\n    IO.inspect tasks\n  end\n\n def download_with_id({id, url}) do\n    file_destination = System.cwd() <> \xe2\x80\x9c/tmp/altered_document_\xe2\x80\x9d <> Atom.to_string(id) <> \xe2\x80\x9c.pdf\xe2\x80\x9d\n    download(url, file_destination)\n    |> Tuple.insert_at(2, id)\n  end\n
Run Code Online (Sandbox Code Playgroud)\n\n

以及该文件的链接:https://github.com/karmaradio/karma/blob/async-download_many/lib/S3.ex#L58

\n\n

我不明白\xe2\x80\x99t 的输出:#Function<1.112846234/2 in Task.build_stream/3>

\n\n

有人经历过类似的事情吗?

\n\n

提前致谢!

\n