Skip to content

Commit 17c2a29

Browse files
committed
Merge branch 'master' into davidbarsky/update-readme
# Conflicts resolved in favour of davidbarsky/update-readme: # Cargo.lock # lambda/Cargo.toml # lambda/examples/README.md # lambda/examples/basic.rs # lambda/examples/error-handling.rs # lambda/src/client.rs # lambda/src/lib.rs
2 parents 186b4db + 6743dd4 commit 17c2a29

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

README.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,11 @@ pub trait Handler<E, O> {
190190

191191
`Handler` provides a default implementation that enables you to provide a Rust closure or function pointer to the `lambda!()` macro.
192192

193-
Optionally, you can pass your own instance of Tokio runtime to the `lambda!()` macro. See our [`with_custom_runtime.rs` example](https://github.com/awslabs/aws-lambda-rust-runtime/tree/master/lambda-runtime/examples/with_custom_runtime.rs)
193+
Optionally, you can pass your own instance of Tokio runtime to the `lambda!()` macro:
194+
```
195+
let rt = tokio::runtime::Runtime::new()?;
196+
lambda!(my_handler, rt);
197+
```
194198

195199
## AWS event objects
196200

lambda/examples/macro.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@ use serde_json::Value;
33

44
type Error = Box<dyn std::error::Error + Send + Sync + 'static>;
55

6+
// #[lambda] attribute removes the need for boilerplate code
7+
// required by `lambda::run(func).await?` as demonstrated in other
8+
// examples.
9+
610
#[lambda]
711
#[tokio::main]
812
async fn main(event: Value, _: Context) -> Result<Value, Error> {

0 commit comments

Comments
 (0)