TTL v3 项目管理
作者: oldratlee创建于 2022年10月5日更新于 2026年9月18日
标签✨ feature📚 documentationtask_❤️__🔥_📐 design discussionttl agentt:v3 ✨
TTL core
API incompatible upgrade
❗️ Incompatible
- ✨ Rename
TransmittableThreadLocal#copymethod totransmiteeValue- Although in most cases, the value being passed is a complex object, it is common to think of copying it, such as deep copying or shallow copying. The method
copyis easy to think of and understand the process and operation involved. - This is also why the method was named
copyinTTL v2. - The name
transmiteeValueis consistent with the method nameInheritableThreadLocal.childValue()in the JDK.
- Although in most cases, the value being passed is a complex object, it is common to think of copying it, such as deep copying or shallow copying. The method
- ✨ Remove
TransmittableThreadLocal'sbefore/after executemethods- The
TransmittableThreadLocalclass is the user API ofTTL, and it should be as simple as possible, containing only the core functionality (not peripheral or optional functionality). - The
before/after executecallbacks are supported by theTransmitterthrough registration. - More discussion
- https://GitHub.com/alibaba/transmittable-thread-local/issues/377#issuecomment-1107827776
- https://GitHub.com/alibaba/transmittable-thread-local/issues/377#issuecomment-1107832086
- The
- Move the inner class
TTL Transmitterunder the root package, making it a subpackage calledtransmitter- Instead of an inner class, the core concept is not a first-class citizen.
- This also leads to the
TransmittableThreadLocalclass file becoming longer and longer…
- ✨ #168
- The
CRRmethod ofTTL Transmitterreturns a specific type, notObject.
- The
- Delete (hidden) interfaces (these were not open interfaces in the first place, and deleting the implementation makes it simpler)
- Delete (hidden)
DisableInheritableThreadFactoryinterface - Delete (hidden)
DisableInheritableForkJoinWorkerThreadFactoryinterface
- Delete (hidden)
- Reduce the number of utility methods to simplify the API
- In
v2, the number of utility methods was excessive due to the switch parameters. - reduce util
- In
内容来源: alibaba/transmittable-thread-local