Launching TradingStream in async mode

I could not receive events triggered by instructions before command, and instructions after that command would never execute. So I figured out this solution where I launch trading_stream._run_forever() asynchronously. Here is the code:

from import TradingStream
from import TradingClient
from import LimitOrderRequest
import asyncio

API_KEY = ''

async def update_handler(data):
    # trade updates will arrive in our async handler

async def run_stream(trading_stream):
    await trading_stream._run_forever()

async def main():
    trading_stream = TradingStream(API_KEY, API_SECRET, paper=True)
    # Start the stream in a separate task and wait 3 seconds for the ws connection to establish
    await asyncio.sleep(3)

    # Send an order to check if we receive events    
    trading_client = TradingClient(API_KEY, API_SECRET, paper=True)
    order = LimitOrderRequest(symbol="TSLA", qty=1, side="buy", type="limit", limit_price=150, time_in_force="day", extended_hours=True)
    print("order sent")

    # Keep the main coroutine running indefinitely
    await asyncio.Event().wait()