Start the runtime and begin polling for events on the Lambda Runtime API. The runtime will process requests sequentially. # Managed concurrency If `AWS_LAMBDA_MAX_CONCURRENCY` is set, a warning is logged. If your handler can satisfy `Clone + Send + 'static`, prefer [`Runtime::run_concurrent`] (requires the `concurrency-tokio` feature), which honors managed concurrency and falls back to sequentia
(self)
| 362 | /// which honors managed concurrency and falls back to sequential behavior when |
| 363 | /// unset. |
| 364 | pub async fn run(self) -> Result<(), BoxError> { |
| 365 | if let Some(raw) = concurrency_env_value() { |
| 366 | log_or_print!( |
| 367 | tracing: tracing::warn!( |
| 368 | "AWS_LAMBDA_MAX_CONCURRENCY is set to '{raw}', but the concurrency-tokio feature is not enabled; running sequentially", |
| 369 | ), |
| 370 | fallback: eprintln!("AWS_LAMBDA_MAX_CONCURRENCY is set to '{raw}', but the concurrency-tokio feature is not enabled; running sequentially") |
| 371 | ); |
| 372 | } |
| 373 | let incoming = incoming(&self.client); |
| 374 | Self::run_with_incoming(self.service, self.config, incoming).await |
| 375 | } |
| 376 | |
| 377 | /// Internal utility function to start the runtime with a customized incoming stream. |
| 378 | /// This implements the core of the [Runtime::run] method. |