Unlike javascript, elixir makes you write synchronous code, e.g.
def process_items(items) do
items
|> Task.async_stream(&Processor.process/1, max_concurrency: 2, timeout: 7000, on_timeout: :kill_task)
|> Enum.to_list()
end
Semantics of regular and concurrent code is the same