Comments (22)
Good news! We are prioritizing this task and have plans to start the initial planning work over the coming months. It is still too early to provide a timeline, but I will reopen this issue so we can track the progress here. Thank you everyone for your patience!
from firebase-admin-python.
I wanted to report that having async support for an auth SDK is very important. This is exactly the area where async frameworks make a huge difference, where you do a client side request inside a server side request.
Please consider adding core support and examples for using with ASGI frameworks, like Starlette:
https://github.com/encode/starlette
from firebase-admin-python.
Can this be not handled in the application code? Basically execute Admin SDK methods like ref.get()
on separate threads.
from firebase-admin-python.
In case anyone runs into the same problem -
Eventually, I am using the REST API.
Calling it asynchronously with aiohttp
.
For auth
I am using the database secret which is DEPRECATED, so it's not ideal, but it works for now.
from firebase-admin-python.
Thank you again for your patience on this!
This is a high priority task for us and we should start seeing the initial changes sometime in Q2/Q3 2022. I can't promise you a timeline for this feature but rest assured that this is something on our immediate roadmap for this year and you will see updates in the coming months.
from firebase-admin-python.
Hey Folks, We just released v5.3.0 which added async support for the Cloud Firestore API. This is the first step into fulfilling this FR so please give it a try and let us know what you think!
from firebase-admin-python.
Most of our users are on Python 2.7, so we cannot directly expose async coroutines from the SDK anytime soon. In the meantime you should be able to get around the scalability issues by using the run_in_executor()
method of the asyncio event loop.
ref = db.reference(path) # Doesn't make RPC calls
executor = concurrent.futures.ThreadPoolExecutor(max_workers=8)
loop = asyncio.get_event_loop()
loop.run_in_executor(executor, ref.get) # Make RPC call on a separate thread
from firebase-admin-python.
Hi! Is there any update about this feature ? I saw a pull request to use new version of the google-auth api, would that fulfill prerequisites ?
from firebase-admin-python.
I agree with the general feeling here. Not having async support is making this library a tad less useful nowadays. Not very future proof unfortunately.
from firebase-admin-python.
There's been no development in this space afaik. We cannot support an async API until the core GCP Python libraries like google-auth
provide async support. For Firestore you can file a feature request directly at https://github.com/googleapis/python-firestore
from firebase-admin-python.
Good to know that python-api-core
is in the process of adding async support. After that we need at least google-auth
to adopt asyncio before we can provide async support (we'd very much like to do so btw). I see that you're already following their issue at googleapis/google-auth-library-python#321.
Firestore APIs are entirely developed in the python-firestore
repo I linked above, and it's their call to support asyncio or not. But I think having async support python-api-core
makes it feasible for them to support it.
from firebase-admin-python.
Hello! I know the last comment wasn't left here long ago, but as it didn't get any answer, I'm posting another one.
Has a timeline been agreed upon since April 2021, and if there is one, could you please let everyone know here?
Many thanks!
from firebase-admin-python.
It won't scale as I would like and, to my opinion, complicates the code and is harder to track.
from firebase-admin-python.
@eranhirs would you feel like starting a async-firebase project that we could contribute to?
from firebase-admin-python.
+1 on this. My project has a few hundred thousand items that need to be worked via Firebase, and ~1 second latency times make wait times intractable without async support
from firebase-admin-python.
Python 2.7 is no longer supported. Any progress here?
from firebase-admin-python.
This needs to be first addressed in other GCP Python libraries that we use as dependencies. More specifically, the google-auth library (which we use to make all authorized HTTP calls) needs to support it. From what I can see, they have plans to add async support starting from 2020, but there is no concrete timetable as of now:
googleapis/google-auth-library-python#321
googleapis/google-cloud-python#3103
I can only imagine that this will take a while considering the engineering effort that is involved. Pretty much all existing APIs have to be re-evaluated and redesigned for async support.
If google-auth takes a very long time to introduce async support, we can consider wrapping the existing google-auth APIs in async threads, so that at least firebase-admin can expose an async API to the developer. But even that is going to require a lot of work, based on some prototyping results I've managed to put together.
from firebase-admin-python.
Is there any development on this front?
Also can you please reopen this issue?
We have been using firestore and lack of async is a very big downside of firestore.
If async supported is not planned for google services, It would be nice if we know beforehand so we can plan our migration to services that support it. Lack of this feature is causing us both money and product quality tbh.
from firebase-admin-python.
It seems there is an open PR related to adding async support.
One of the contributors to the libraries just left a comment.
Would be great to hear about firebase-admin maintainers/contributors perspective on this. :)
Edit: I will look into the repo you linked and file a feature request maybe, thanks for the reply :)
from firebase-admin-python.
Great to hear these, thanks a lot @hiranya911 :)
I will look around in the python-firestore
for the discussion, and maybe check if they have something planned. 🚀
from firebase-admin-python.
It seems that an async-based auth flow was added to google-auth
in September of last year: https://github.com/googleapis/google-auth-library-python/blob/master/CHANGELOG.md#1220-2020-09-28
googleapis/google-auth-library-python#612
Are there any plans to make this library async-compatible now that its dependencies seem to have done so?
from firebase-admin-python.
Seems to be working well, we haven't used this under heavy load yet, though.
I'm curious to hear how others are experiencing this, but AFAIK it's good and robust.
We mostly use firestore and do async gcloud storage uploads too, so things are pretty good.
Messages seems to be one thing missing? #639
That would be actually nice to have.
from firebase-admin-python.
Related Issues (20)
- [FR] - When using Email/Password authentication, add a way to login with the password HOT 2
- Transaction contextmanager does not set transaction to in_progress HOT 2
- python-jwt is deprecated HOT 2
- firebase_admin installed and got PyJWKClient issue HOT 2
- [FR] Download url like with node js client HOT 1
- Github Desktop Pull/Push Issue HOT 2
- [FR] Adding global var HOT 1
- Option to pass values to the transaction function callback HOT 1
- auth.verify_id_token throwing ValueError HOT 1
- [FR] Add Support for Pyodide by providing a wheel with binaries built for Emscripten. HOT 2
- [FR] Add WebApps support to project_management HOT 1
- Couldn't import app_check HOT 1
- Firebase functions container silently freezes on making a get request to Firestore if multiple requests were created before container starts HOT 3
- Call to Firestore getting timed out from the docker container. HOT 1
- Querying Firestore documents by nested key-value in an array field using Python HOT 1
- firestore times out when using default DNS resolver HOT 1
- [FR] Async `messaging` requests HOT 1
- import firebase admin HOT 3
- Using cloud run from gcp console to firebase HOT 1
- Cloud run from gcp console HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from firebase-admin-python.