Skip to content

Commit e193e70

Browse files
authored
Retire INVOCATION_CTX task local; lambda::Context is now a normal argument (#237)
1 parent ae3ce1d commit e193e70

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

lambda/src/lib.rs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -89,10 +89,6 @@ impl Config {
8989
}
9090
}
9191

92-
tokio::task_local! {
93-
pub static INVOCATION_CTX: types::Context;
94-
}
95-
9692
/// A trait describing an asynchronous function `A` to `B.
9793
pub trait Handler<A, B> {
9894
/// Errors returned by this handler.
@@ -212,7 +208,7 @@ where
212208
let body = serde_json::from_slice(&body)?;
213209

214210
let request_id = &ctx.request_id.clone();
215-
let f = INVOCATION_CTX.scope(ctx.clone(), handler.call(body, ctx));
211+
let f = handler.call(body, ctx);
216212

217213
let req = match f.await {
218214
Ok(res) => EventCompletionRequest { request_id, body: res }.into_req()?,

0 commit comments

Comments
 (0)