transmittable-thread-local
transmittable-thread-local copied to clipboard
improve the type safety of transmitter
capture() --captured--> replay() --backup--> restore()
|
clear() --/
capture
/replay
/clear
/restore
method in Transmitter
is not type-safe(use generic type Object
).
https://github.com/alibaba/transmittable-thread-local/blob/2a7667a2f3e9c65e71bfa42074a579344f538ced/src/main/java/com/alibaba/ttl/TransmittableThreadLocal.java#L362-L370
improve the type safety of transmitter
- the input of
replay
should be constricted to the output ofcapture
. - the input of
restore
should be constricted to the output ofreplay
/clear
.