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

Function main

examples/dynamic_batching.rs:6–60  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

4
5#[tokio::main]
6async fn main() {
7
8 let producer_factory = || Prod;
9 let producer_concurrency = 3;
10 let producer_router = RouterType::RoundRobin;
11 let producer_buffer_pool = 100;
12
13
14 let proc_factory = || Layer1Process;
15 let proc_concurrency = 3;
16 let proc_router = RouterType::Partition;
17 let proc_buffer_size = 10;
18
19
20 let batcher_factory = || Batcher;
21 let batcher_concurrency = 2;
22 let batcher_buffer_size = 10;
23 let batcher_batch_size = 10;
24 let batcher_batch_timeout: BATCH_TIMEOUT;
25
26
27
28 // ---> batcher[category_id]
29 // /
30 // / processor-1 /
31 // producer-1 / -----> batcher[category_id]
32 // producer-2 ---- processor-2 \
33 // producer-3 \ \
34 // \ processor-3 -----> batcher[category_id]
35
36 let safe_shutdown =
37 run_topology_1_with_batcher(
38 producer_factory,
39 producer_concurrency,
40 producer_router,
41 producer_buffer_pool,
42
43 proc_factory,
44 proc_concurrency,
45 proc_router,
46 proc_buffer_size,
47
48 batcher_factory,
49 batcher_concurrency,
50 batcher_buffer_size,
51 batcher_batch_size,
52 batcher_batch_timeout
53 );
54
55
56 // Safe Shutdown from (Producer) to (Layer_X_Processor)
57 safe_shutdown.send(());
58
59
60}
61
62
63

Callers

nothing calls this directly

Calls 1

Tested by

no test coverage detected