Skip to content

Instantly share code, notes, and snippets.

@amyreese
Created January 2, 2019 22:48
Show Gist options
  • Save amyreese/d554e4e7b6f3c8a6030c2ad1a16f941e to your computer and use it in GitHub Desktop.
Save amyreese/d554e4e7b6f3c8a6030c2ad1a16f941e to your computer and use it in GitHub Desktop.
import asyncio
from aiohttp import request
from aiomultiprocess import Worker
async def get(url):
async with request("GET", url) as response:
return await response.text("utf-8")
async def main():
p = Worker(target=get, args=("https://jreese.sh", ))
response = await p
# asyncio.run(main())
loop = asyncio.get_event_loop()
loop.run_until_complete(main())
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment