MCPcopy Create free account
hub / github.com/Rustixir/tokio_sky / handle_batch

Method handle_batch

examples/dynamic_batching.rs:148–169  ·  view source on GitHub ↗
(&mut self, batch: Vec<Product>)

Source from the content-addressed store, hash-verified

146 async fn drain(&mut self, batch: Vec<Product>);
147
148 async fn handle_batch(&mut self, batch: Vec<Product>) -> Result<(), BatcherTerminate<Input>> {
149
150 // we just check first product
151 // because we now all others same for current instance
152
153 let ct = batch[0].ctype;
154
155 match ct {
156 Category::Cars => {
157 self.batch_cars_insert(batch);
158 }
159 Category::Mobiles => {
160 self.batch_mobiles_insert(batch);
161 }
162 Category::Accessories => {
163 self.batch_accessories_insert(batch);
164 }
165 }
166
167
168 ProcResult::Continue
169 }
170}
171
172

Callers

nothing calls this directly

Calls 3

batch_cars_insertMethod · 0.80
batch_mobiles_insertMethod · 0.80

Tested by

no test coverage detected