Skip to content

ericmcbride/tonic-server-side-batching

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Tonic Server Side Batching (Must have Nightly Running)

Sometimes you need to batch some gRPC requests to do some computations somewhere. Here is a vanilla example of how to do that.

How to run examples

  • cargo run --release --bin batch-server
  • cargo run --release --bin batch-client

Run Bench:

  • Make sure your running nightly rustup default nightly
  • cargo run --release --bin batch-server
  • cargo bench

Thought Process

I left the batch scheduler pretty empty on purpose. Ideally you'd declare a vector, and you would push onto the vector until you hit a threshold, then do some action, flush, repeat. The batch scheduler runs in the background, allowing the gRPC server to communicate to it.

About

Example of tonic server side batching

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages