Closed rbw closed 3 years ago
Add a simple asyncio.run() wrapper that can be used as an alternative to asyncio.run; a simple addition that would result in less code and a more native feel.
Start with a simple wrapper:
def go(func, *args, **kwargs): asyncio.run(func())
Usage:
import aiosnow from aiosnow.models.table.declared import IncidentModel as Incident ADDRESS = "instance.service-now.com" CREDENTIALS = "user", "pw" async def my_func(): client = aiosnow.Client(ADDRESS, basic_auth=CREDENTIALS) async with Incident(client, table_name="incident") as inc: for response in await inc.get(limit=5): print(response["number"]) aiosnow.go(my_func)
Add a simple asyncio.run() wrapper that can be used as an alternative to asyncio.run; a simple addition that would result in less code and a more native feel.
Start with a simple wrapper:
Usage: