Use the await and yield Functions to Retrieve Results
Learn to retrieve results using the task await and task yield functions from task results.
We'll cover the following...
To retrieve the task result, we can use the Task.await/1
or the Task.yield/1
function. Both accept a Task
struct as an argument. There is an essential difference in how await/1
and yield/1
work, so we have to choose wisely. They both stop the program and try to retrieve the task’s result. The difference ...