from asyncio import Future
import asyncio


async def test_1():
    my_future = Future()
    print(f'my_future готов? {my_future.done()}')
    my_future.set_result(42)
    print(f'my_future готов? {my_future.done()}')
    print(f'Какой результат хранится в my_future? {my_future.result()}')


def make_request() -> Future:
    future = Future()
    asyncio.create_task(set_future_value(future))
    return future


async def set_future_value(future) -> None:
    await asyncio.sleep(1)
    future.set_result(42)


async def test_2():
    future = make_request()
    print(f'my_future готов? {future.done()}')
    value = await future
    print(f'my_future готов? {future.done()}')
    print(value)



async def main():
    pass
    # test_1()
    # test_2()


if __name__ == '__main__':
    asyncio.run(test_2())