alibaba / alibaba/transmittable-thread-local
在带IO(Netty)的场景下,基于本项目有没有什么好的办法能做到跨线程传递对象?
- Dominant language
- Java
- Stars
- 8.3k
- Forks
- 1.7k
- PR merge metrics
- No merged PRs in 30d
Description
其实问题比较简单,就是 像这样的异步调用是否有
除了用`TtlRunnable/TtlWrappers`修饰回调以外的方法,在回调和外部传递类似`MDC`的参数?
```mermaid
sequenceDiagram
participant u as Controller
participant c as CompletionStage
participant n as netty-framework
participant r as remote
Note over u: 这里有一个上下文对象Context
u->>+n: query
n-->>+r: network
n->>-c: CompletionStage
r-->>-n: network
n-->>c: complete
c-->>u: thenXxxx
Note over u: 这里需要访问上面的Context
```
Contributor guide
Research direction
Start by reading the project's TtlRunnable and TtlWrappers entry points, then trace how a CompletionStage callback and Netty execution cross thread boundaries. The issue does not name files or tests and does not define an acceptance criterion; done would require an agreed design and corresponding validation for carrying Context-like values without manually wrapping callbacks.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- backend
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100