Async and notebooks¶
Synchronous methods work everywhere, including inside a running event loop such as a Jupyter cell. There, a synchronous call runs its work on a worker thread and blocks until it ends, as time.sleep would. Ctrl-C in the cell stops the local poll within one poll interval.
The awaited twins keep the event loop responsive while they wait: create_async, get_async, wait_async, cancel_async, jobs.get_async, and for endpoints stop_async, start_async, delete_async, endpoints.get_async. Use them in an async web service, or to wait on several jobs at once.
In a notebook, call the synchronous methods, or await the twins directly in a cell. The notebooks do it step by step.
Cancelling an await does not cancel the cloud resource
Interrupting a cell, a synchronous wait(), or cancelling wait_async stops the local poll and its progress display. The job keeps running, and the endpoint keeps billing. Only cancel / cancel_async cancels a job, and only delete / delete_async deletes an endpoint.