Reactive queries in Python
Can I do reactive queries in python? On PyPl the title of convex library is "Python client for the reactive backend-as-a-service Convex.", but I don't see any examples of it.
10 Replies
hi @aitkn, you're right that this is confusing. Convex the platform is certainly reactive but the python client specifically doesn't have support for subscriptions yet
this has been on our roadmap for a while but we haven't yet prioritized it
sorry for the inconvenience. if you're willing to share any info on the use-case you'd like python subscriptions (reactivity) for that would be useful context re prioritizing
I have a "Processor" application that performs computationally intensive calculations based on user input and returns some output. I'm running multiple instances of this application on a server, but it can also be run on a client machine. Users input data through a web or mobile app. I need my "Processor" application to "listen" for these changes, perform the processing, and save the results back to the database so that users can view them reactively. Currently, I'm using Firebase Firestore as my database, but I'm considering switching to Convex. However, this feature is a deal-breaker for me.
this makes a lot of sense. it wouldn't be a huge task for us to build this into the python client so keep an eye out for us adding this in the future!
Thank you for the response. It's good to hear that adding this feature to the Python client is manageable. I'm in the early stages of considering a switch to Convex, and if this feature can be implemented within a month or so, I'll be more confident in continuing with the transition. I appreciate your help and look forward to any updates on this matter.
it's definitely manageable and we have a rust client with subscriptions coming out soon. in the meantime you might want to spend a bit of time with the React client since that's the best-supported platform so far. Convex is a great fit for react, unsurprisingly, but we intend to support any platform over time
can't commit to timelines yet on python subscriptions but we have features coming out very fast so stay tuned
@aitkn for what it’s worth, a Rust client is coming out soon with parity to the JavaScript one… full reactivity and so on
We’re really excited about better support for use cases like yours soon
This has definitely been a part of the convex vision all along, enabling apps like yours
Essentially leveraging reactivity for workflow type backend situations in addition to UIs.
Oh. James already mentioned this. 😀
Can I run a reactive query from Node?
Yes. Use https://docs.convex.dev/api/classes/browser.BaseConvexClient to get access to subscriptions outside react.
Class: BaseConvexClient | Convex Developer Hub
browser.BaseConvexClient
In fact, react subscriptions are built on top of this API.
@aitkn the Rust client has arrived: https://blog.convex.dev/announcing-convex-0-14-0/
Convex News
Announcing Convex 0.14.0
Meet the brand new Convex Rust client! We’ve also open sourced the JS client, added schema validation, and more. 0.14.0 is the best version of Convex yet!