-
tokio
A runtime for writing reliable asynchronous applications with Rust. Provides I/O, networking, scheduling, timers, ...
-
InfluxDB
Power Real-Time Data Analytics at Scale. Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.
-
SaaSHub
SaaSHub - Software Alternatives and Reviews. SaaSHub helps you find the best software and product alternatives
Hello there. So I need something similar to dynamically loading linked libraries, but not quite. Essentially, I need to call a function which will generate some Rust code (tonic-build to generate Rust bindings from a .proto file if you're interested). Then some code to implement the generated traits needs to be generated (i'm thinking macros is the best way to go for this). The generated structs implementing the tonic generated traits then need to be used normally. All of this needs to happen at runtime. I'm fairly stuck on how to approach this. From reading discussion forums, blogs, etc. WASM seems to be a candidate solution for this kinda problem. Could someone kindly explain how WASM can be of help here? Thanks! :D
But for tonic to work, it would also need to support Webassembly (more specifically: WASI), which would require tokio to support it, which it does not.
Using wasmer you can load WASM binaries and execute them at runtime. I was playing around with this about a year ago and wrote a prototype example: https://github.com/pmsanford/wasmloading
This doesn't address the generate-and-build step, but you can probably accomplish that by shelling out (perhaps with duct) to cargo build assuming your runtime environment has the necessary tools installed.
Using wasmer you can load WASM binaries and execute them at runtime. I was playing around with this about a year ago and wrote a prototype example: https://github.com/pmsanford/wasmloading