You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Flow allows developers to express computations on collections, similar to the Enum and Stream modules, although computations will be executed in parallel using multiple GenStages.
Here is a quick example on how to count words in a document in parallel with Flow:
Flow requires Elixir v1.7 and Erlang/OTP 22+. Add :flow to your list of dependencies in mix.exs:
defdepsdo[{:flow,"~> 1.0"}]end
Usage in Livebook
Flow pipelines starts several processes linked to the current process. This means that, if there is an error in your Flow, it will shut down the Livebook runtime. You can avoid this in your notebooks in two different ways:
Use Flow.stream(flow, link: false) to explicitly convert a Flow to a non-linked stream. You can them invoke Enum and Stream functions regularly:
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
https://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.