top | item 20676186

(no title)

Zxian | 6 years ago

Your analogy works as long as there's a machine doing the washing and drying.

If you replace the machines with people, it makes much more sense for the function definition to define what is and isn't synchronous. If you have to do all the chores yourself, just call the functions synchronously. If you have family members you can delegate some work to, you can call the functions asynchronously and wait for them to complete while you're doing your own work (or twiddling your thumbs).

Elixir allows you to do this very cleanly. https://hexdocs.pm/elixir/Task.html#content

discuss

order

No comments yet.