Retrieve a Task’s Results
Learn to use Task.async, which has the property to return a struct containing the executed task’s result.
We'll cover the following
The Task.async/1
task
To retrieve the result of a function, we use Task.async/1
. It returns a %Task{}
struct which we can assign to a variable for later use. We can give it a try in IEx like this:
This is the executable command:
Get hands-on with 1300+ tech skills courses.