(mut service: S, config: Arc<Config>, client: Arc<ApiClient>)
| 457 | |
| 458 | #[cfg(feature = "concurrency-tokio")] |
| 459 | async fn concurrent_worker_loop<S>(mut service: S, config: Arc<Config>, client: Arc<ApiClient>) -> Result<(), BoxError> |
| 460 | where |
| 461 | S: Service<LambdaInvocation, Response = (), Error = BoxError>, |
| 462 | S::Future: Send, |
| 463 | { |
| 464 | let task_id = tokio::task::id(); |
| 465 | let span = info_span!("worker", task_id = %task_id); |
| 466 | loop { |
| 467 | let event = match next_event_future(client.as_ref()).instrument(span.clone()).await { |
| 468 | Ok(event) => event, |
| 469 | Err(e) => { |
| 470 | warn!(task_id = %task_id, error = %e, "Error polling /next, retrying"); |
| 471 | continue; |
| 472 | } |
| 473 | }; |
| 474 | |
| 475 | process_invocation(&mut service, &config, event, false) |
| 476 | .instrument(span.clone()) |
| 477 | .await?; |
| 478 | } |
| 479 | } |
| 480 | |
| 481 | async fn process_invocation<S>( |
| 482 | service: &mut S, |
no test coverage detected