amoghrajesh commented on code in PR #72131:
URL: https://github.com/apache/airflow/pull/72131#discussion_r3966973662


##########
airflow-core/docs/administration-and-deployment/task-and-asset-state-store.rst:
##########
@@ -138,6 +138,17 @@ Each method receives a ``scope`` argument that is either a 
:class:`~airflow.sdk.
             elif isinstance(scope, AssetScope):
                 return self._asset_store.get(scope, key)
 
+If the storage client is synchronous, implement the async methods by 
offloading the sync work to a worker thread rather than calling it inline, so 
callers on an event loop (``async`` tasks and watcher triggers) are not blocked:
+
+.. code-block:: python
+
+    import asyncio
+
+
+    class MyBackend(BaseStoreBackend):
+        async def aget(self, scope, key, *, session=None):
+            return await asyncio.to_thread(self.get, scope, key)

Review Comment:
   Better to define the whole interface, users might confuse with partial 
overriding



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to