chore: updated schemas

This commit is contained in:
TotallyNot 2025-05-19 20:09:38 +02:00
parent b4ce0c764e
commit 73358b70cc
Signed by: pyrite
GPG key ID: 7F1BA9170CD35D15
11 changed files with 1628 additions and 100 deletions

View file

@ -569,17 +569,16 @@ where
fn execute<R>(
self,
requests: impl IntoIterator<Item = R>,
) -> impl futures::Stream<Item = (R::Discriminant, Result<ApiResponse, Self::Error>)>
) -> impl futures::Stream<Item = (R::Discriminant, Result<ApiResponse, Self::Error>)> + Unpin
where
R: torn_api::request::IntoRequest,
{
let requests: Vec<_> = requests.into_iter().map(|r| r.into_request()).collect();
self.pool
.execute_bulk_requests(
self.selector.clone(),
requests.into_iter().map(|r| r.into_request()),
)
.execute_bulk_requests(self.selector.clone(), requests)
.into_stream()
.flatten()
.boxed()
}
}
@ -640,22 +639,23 @@ where
fn execute<R>(
self,
requests: impl IntoIterator<Item = R>,
) -> impl futures::Stream<Item = (R::Discriminant, Result<ApiResponse, Self::Error>)>
) -> impl futures::Stream<Item = (R::Discriminant, Result<ApiResponse, Self::Error>)> + Unpin
where
R: torn_api::request::IntoRequest,
{
let requests: Vec<_> = requests.into_iter().map(|r| r.into_request()).collect();
StreamExt::map(
futures::stream::iter(requests).throttle(self.distance),
move |r| {
move |(d, request)| {
let this = self.clone();
async move {
let (d, request) = r.into_request();
let result = this.execute_request(request).await;
(d, result)
}
},
)
.buffer_unordered(25)
.boxed()
}
}