MCPcopy Create free account
hub / github.com/SorellaLabs/cex-exchanges / normalized_mutlithreaded_util

Function normalized_mutlithreaded_util

tests/utils.rs:85–110  ·  view source on GitHub ↗
(builder: NormalizedExchangeBuilder, iterations: usize)

Source from the content-addressed store, hash-verified

83}
84
85pub async fn normalized_mutlithreaded_util(builder: NormalizedExchangeBuilder, iterations: usize) {
86 let mut rx = builder
87 .build_all_multithreaded(1, WsStreamConfig::default().with_max_retries(10), Some(25))
88 .unwrap()
89 .unwrap();
90 info!(target: "cex-exchanges::tests::ws", "connected stream");
91
92 let mut i = 0;
93 while let Some(val) = rx.next().await {
94 if val.is_err() {
95 error!(target: "cex-exchanges::tests::ws", "{:?}", val);
96 }
97
98 info!(target: "cex-exchanges::tests::ws", "completed {i}/{iterations}");
99
100 assert!(val.is_ok());
101
102 let normalized = val.clone().normalize();
103 assert_eq!(val, normalized);
104
105 if i == iterations {
106 break;
107 }
108 i += 1;
109 }
110}
111
112pub fn write_json<D>(a: D, path: &str)
113where

Calls 4

with_max_retriesMethod · 0.80
is_errMethod · 0.80
normalizeMethod · 0.45