Difference between await & block_on()

Only answering the title of the question (since the rest of it is not very clear to me): await is the opposite of blocking. Awaiting means that the current task gives up control to the runtime, so it is not being run for some amount of time, and other tasks are allowed to make progress. Blocking on the other hand means that the task remains active and continues to assert control, i.e. it doesn't allow other tasks scheduled on the same thread to run, even if it isn't doing anything useful.

1 Like