【文件属性】:
文件名称:流:GenStage之上的计算并行流
文件大小:55KB
文件格式:ZIP
更新时间:2021-02-24 05:44:50
Elixir
流动
尽管将使用多个并行执行计算,但Flow允许开发人员在集合上表达计算,类似于Enum和Stream模块。
这是有关如何与Flow并行计算文档中单词的简单示例:
File . stream! ( " path/to/some/file " )
|> Flow . from_enumerable ()
|> Flow . flat_map ( & String . split ( &1 , " " ))
|> Flow . partition ()
|> Flow . reduce ( fn -> %{} end , fn word, acc ->
Map . update (acc, word, 1 , & &1 + 1 )
end )
|> Enum . to_list ()
请参阅文档或介绍和背后的主要概念。
安装
Flow需要Elixir v1.5和Erlang / O
【文件预览】:
flow-master
----mix.exs(814B)
----.github()
--------workflows()
----lib()
--------flow.ex(73KB)
--------flow()
----.formatter.exs(67B)
----test()
--------flow()
--------test_helper.exs(140B)
--------flow_test.exs(49KB)
----README.md(2KB)
----mix.lock(2KB)
----.gitignore(46B)
----CHANGELOG.md(6KB)