Closed danryu closed 3 years ago
Currently droplet.create() wraps a synchronous POST request to the API (calls get_data()) https://github.com/koalalorenzo/python-digitalocean/blob/027b56cbf7e67dbb67673fd6462b85f2c0428f6d/digitalocean/Droplet.py#L568
Could create() be refactored to return a meaningful value? This would mean it can be used with 'await' to allow asynchronous operation, eg await droplet.create()
await droplet.create()
Otherwise you see this: TypeError: object NoneType can't be used in 'await' expression
TypeError: object NoneType can't be used in 'await' expression
Don't think this is necessary. FWIW I am using this in async lib gevent with Celery.
Currently droplet.create() wraps a synchronous POST request to the API (calls get_data()) https://github.com/koalalorenzo/python-digitalocean/blob/027b56cbf7e67dbb67673fd6462b85f2c0428f6d/digitalocean/Droplet.py#L568
Could create() be refactored to return a meaningful value? This would mean it can be used with 'await' to allow asynchronous operation, eg
await droplet.create()
Otherwise you see this:
TypeError: object NoneType can't be used in 'await' expression