!(image1)[https://imgur.com/5qaPfr3.png]
actix-web-tonic
actix-web-tonic
is the concurrent runner ofactix-web
+tonic
.- You can build a rich and fast server app using Web + gRPC so easily with the crate.
Usage
- Implement your
actix-web
server same as basically coding, and get the future:
let actix_future = new
- Implement your
tonic
server same as basically coding, and get the future:
let tonic_future = builder.add_service
- Invoke in concurrent both of your actix-web future and your tonic future:
let tonic_worker_threads = 16; // <- # of workers setting is here in tonic.(=# of tokio workers)
let result = invoke;
And then, test your server:
# gRPC:
{
}
# Web:
) )
> GET
> Host:
> User-Agent:
> Accept:
>
< HTTP/1.1
- Want you all of the example?
- => The full example is here: examples/simple/
Motivation and Notes
- I had try implements a single bin process actix-web + tonic service but it was little hard to code for every works. Then, I publish this crate. It will be a good little helps to the
future
of me, and ofcourse you who looks this crate.💕 - Of course, this crate is for servers. If your goal is not to provide a server, you want to complete an applications, you will also need crates for the client side to fight WASM, HTML/CSS and UI/UX.💪
LICENSE
Author
- USAGI.NETWORK / Usagi Ito https://github.com/usagi/