Tilebox offers a standard synchronous API by default but also provides an async client option when needed.
asyncio
.
Client
. The example below illustrates this change.
await
for operations that interact with the Tilebox API.
await some_async_call()
as the output of a code cell.show_progress
enabled, the progress bars update concurrently.
async
code to take advantage of asynchronous execution, such as parallel data loading. You can achieve this by wrapping your async code in asyncio.run
.
Below is an example of using async code within a workflow task.
RuntimeError: asyncio.run() cannot be called from a running event loop
, it means you’re trying to start another asyncio event loop (with asyncio.run
) from within an existing one. This often happens in Jupyter notebooks since they automatically start an event loop. A way to resolve this is by using nest-asyncio.