Our great sponsors
-
WorkOS
The modern identity platform for B2B SaaS. The APIs are flexible and easy-to-use, supporting authentication, user identity, and complex enterprise features like SSO and SCIM provisioning.
Some research: - Found a crate for exactly what I want, called batched_fn which seems to do exactly what I want with a catch that I cannot run async tasks (download, preprocess, etc) within the batch handler, ie, it's specifically for inference. I've opened an issue about it. - What I plan to do, is : - The response handlers pass their id's to a batching mechanism, and have a reciver for the output channel(details below) - to have a batching mechanism that batches up image id's on high load. - Pass it to another thread that downloads, preprocesses it and infers form it - This thread passes it to the result channel that every response handler has a reciever for. Every response handler checks if the message that it's reciving is for itself, and accordingly returns a JSON API response
ZCash has implemeted a tower service for this. I don't believe they release it as a crate, but should be useful https://github.com/ZcashFoundation/zebra/tree/main/tower-batch