title: Executing an awaitable / async function in Python RQ
body: <p>My jobs are all a series of requests that need to be made per object. Ie, its a <code>User</code> with several data points (potentially hundreds) that need to be added to that user with requests. I had originally written those requests to run synchronously but it was blocking and slow. I was sending each <code>User</code> job to Python RQ and have 10 workers going through the Users sent down the queue. 1 worker, 1 user, blocking requests.</p>
  <p>I've re-written my User job to use aiohttp instead of python requests, and its significantly faster. On the Python RQ documentation it says that 'Any Python function call can be put on an RQ queue.' but I can't figure out how to send my async function down the queue?</p>
  <pre><code>
  async def get_prices(calls: List[dict]) -&gt; List[dict]:
       async with aiohttp.ClientSession() as session:
           for price in prices.items():
                  price_type, date = price
                  price = await pg.get_price(
                      session=session, lookup_date=date
                  )
          do_some_other_stuff()
          await session.close()
  
  </code></pre>
  <pre><code>
  from core.extensions import test_queue
  from prices import get_prices
  job = test_queue.enqueue(get_prices, kwargs={&quot;username&quot;:'username'})
  
  </code></pre>
  <p>The problem is that <code>get_prices</code> is never awaited, it just remains a coroutine futures.... How can I await my function on the queue?</p>