Today, we're excited to announce H2O Wave v0.9.0, with a new
wave CLI, live-reload, improved performance, background tasks and ASGI compatibility.
Among other changes, the Wave server executable
wave is now called
waved (as in
wave daemon), and the h2o-wave Python package ships with a new CLI named
No more listening
listen() has been deprecated in favor of
@app. Wave apps are now one line shorter.
In versions <= v0.8.0, a skeleton app looked like this:
The above app could be run like this:
In versions v0.9.0+, a skeleton app looks like this:
listen(route)has been replaced by an
@app(route)decorator on the
mainneeds to be imported into the file (but you don't have to do anything with the symbol
mainother than simply
The above app can be run using
wave run, built into the new
wave command line interface.
wave run command runs your app using live-reload, which means you can view your changes live as you code, without having to refresh your browser manually.
To run your app without live-reload, simply pass
Both the Wave server and application communication architecture has undergone significant performance and concurrency improvements across the board. Apps should now feel lighter, quicker, and more responsive under concurrent or increased load.
The changes in v0.9 brings us closer to a v1.0 release. v1.0 will include the ability to increase the number of worker processes to scale apps, while preserving the simplicity of the Wave API.
The Wave Tour (
tour.py) is now quicker and more reliable:
The API now provides the ability to run blocking calls in the background to improve app responsiveness. The query context
q now has two lightweight wrappers over asyncio.run_in_executor():
Here is an example of a function that blocks:
To call the above function from an app, don't do this:
Instead, do this:
q.run() runs the blocking function in the background, in-process.
Depending on your use case, you might want to use a separate process pool or thread pool from Python's multiprocessing library, like this:
q.exec() accepts a custom process pool or thread pool to run the blocking function.
To run your app using an ASGI server like uvicorn, append
:main to the
Get the release here. Check out the release notes for more details.
We look forward to continuing our collaboration with the community and hearing your feedback as we further improve and expand the H2O Wave platform.
We’d like to thank the entire Wave team and the community for all of the contributions to this work!