As the names implies, run_forever causes event_loop to run forever or at least until it's explicitly stopped by calling its stop method. On the other hand, the run_until_complete method causes the loop to keep going until a particular future object is ready to provide a value (refer to the following code example):
The return value of ensure_future is a future object, so you can easily run the scheduler until a particular task is done. The preceding code example runs two coroutines simultaneously as two separate tasks in the same scheduler. The coro1() coroutine contains an infinite loop, so it will ...