Skip to content

Conversation

@tisonkun
Copy link
Contributor

@tisonkun tisonkun commented Oct 8, 2025

This closes #185.

Signed-off-by: tison <[email protected]>
Signed-off-by: tison <[email protected]>
Signed-off-by: tison <[email protected]>
Comment on lines +115 to +120
TASK_LOCAL_MAP.with(|map| {
let mut map = map.borrow_mut();
for (key, value) in this.context.iter() {
map.push((key.clone(), value.clone()));
}
});
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This may not be quite efficient. But generally kvs are small and we can anyway improve later.

Signed-off-by: tison <[email protected]>
@tisonkun tisonkun enabled auto-merge (squash) October 10, 2025 10:23
@tisonkun tisonkun merged commit 802c407 into main Oct 10, 2025
9 checks passed
@tisonkun tisonkun deleted the tokio-local-set branch October 10, 2025 10:27
Comment on lines +69 to +74
fn with_task_local_context(
self,
kvs: impl IntoIterator<Item = (String, String)>,
) -> impl Future<Output = Self::Output>
where
Self: Sized,
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd prefer a shorter name, but not have a good idea now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[HELP] Adding custom fields to all logs without propagating them to log usages?

1 participant