biothings/biothings.api

change extras method of MetadataSourceHandler to be async

newgene opened this issue · 3 comments

We should make this extras method an async method, so that it can be used to call other async functions/methods:

def extras(self, _meta):
"""
Override to add app specific metadata.
"""
return _meta

For use cases without async calls, it can be a simple yield to return updated _meta value.

We should check other API instances override extras and make the change to work with this new change.

Here is a use case in MyGene.info repo:

https://github.com/biothings/mygene.info/blob/409c1d812dac4218c042c02d30b8fe87912882c2/src/web/handlers.py#L65-L76

released in 0.12.0