(handler: F)
| 183 | #[cfg(feature = "concurrency-tokio")] |
| 184 | #[cfg_attr(docsrs, doc(cfg(feature = "concurrency-tokio")))] |
| 185 | pub async fn run_concurrent<A, F, R, B, S, D, E>(handler: F) -> Result<(), Error> |
| 186 | where |
| 187 | F: Service<LambdaEvent<A>, Response = R> + Clone + Send + 'static, |
| 188 | F::Future: Future<Output = Result<R, F::Error>> + Send + 'static, |
| 189 | F::Error: Into<Diagnostic> + fmt::Debug, |
| 190 | A: for<'de> Deserialize<'de> + Send + 'static, |
| 191 | R: IntoFunctionResponse<B, S> + Send + 'static, |
| 192 | B: Serialize + Send + 'static, |
| 193 | S: Stream<Item = Result<D, E>> + Unpin + Send + 'static, |
| 194 | D: Into<bytes::Bytes> + Send + 'static, |
| 195 | E: Into<Error> + Send + Debug + 'static, |
| 196 | { |
| 197 | let runtime = Runtime::new(handler).layer(layers::TracingLayer::new()); |
| 198 | runtime.run_concurrent().await |
| 199 | } |
| 200 | |
| 201 | /// Spawns a task that will be execute a provided async closure when the process |
| 202 | /// receives unix graceful shutdown signals. If the closure takes longer than 500ms |
nothing calls this directly
no test coverage detected