MCPcopy Index your code
hub / github.com/aws/aws-lambda-rust-runtime / concurrent_worker_loop

Function concurrent_worker_loop

lambda-runtime/src/runtime.rs:459–479  ·  view source on GitHub ↗
(mut service: S, config: Arc<Config>, client: Arc<ApiClient>)

Source from the content-addressed store, hash-verified

457
458#[cfg(feature = "concurrency-tokio")]
459async fn concurrent_worker_loop<S>(mut service: S, config: Arc<Config>, client: Arc<ApiClient>) -> Result<(), BoxError>
460where
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
481async fn process_invocation<S>(
482 service: &mut S,

Callers 1

run_concurrent_innerMethod · 0.85

Calls 4

next_event_futureFunction · 0.85
process_invocationFunction · 0.85
as_refMethod · 0.80
cloneMethod · 0.45

Tested by

no test coverage detected