Created
February 6, 2019 11:57
-
-
Save dinocosta/b915deaf7df97a078d7db79e76d167e9 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| defmodule Processor do | |
| def process(number) do | |
| :timer.sleep(6000) | |
| end | |
| end | |
| 1..10 | |
| |> Task.async_stream(&Processor.process/1, timeout: 7000) | |
| |> Enum.to_list() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment