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
{ | |
"name": "Wildberries Darker", | |
"appearance": "dark", | |
"style": { | |
"background.appearance": "opaque", | |
"accents": [], | |
"border": null, | |
"border.variant": null, | |
"border.focused": null, | |
"border.selected": null, |
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(1000) | |
{number, :os.system_time(:millisecond)} | |
end | |
end | |
1..10 | |
|> Task.async_stream(&Processor.process/1, max_concurrency: 2) | |
|> Enum.to_list() |
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(10000 - (number * 1000)) | |
number | |
end | |
end | |
1..10 | |
|> Task.async_stream(&Processor.process/1, on_timeout: :kill_task) | |
|> Enum.to_list() |
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() |
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) | |
|> Enum.to_list() |
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 Increaser do | |
def increase(number) do | |
number + 1 | |
end | |
end | |
Task.async_stream(1..10, &Increaser.increase/1) |
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
1..10 | |
|> Task.async_stream(fn(number) -> number + 1 end) | |
|> Enum.map(fn({:ok, result}) -> result end) |
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
1..10 | |
|> Task.async_stream(fn(number) -> number + 1 end) | |
|> Enum.to_list() |
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
Task.async_stream(1..10, fn(number) -> number + 1 end) |
NewerOlder