Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

improve the type safety of transmitter #168

Closed
oldratlee opened this issue Mar 16, 2020 · 1 comment
Closed

improve the type safety of transmitter #168

oldratlee opened this issue Mar 16, 2020 · 1 comment

Comments

@oldratlee
Copy link
Member

oldratlee commented Mar 16, 2020

capture() --captured--> replay() --backup--> restore()
                                   |
                        clear()  --/             

capture/replay/clear/restore method in Transmitter is not type-safe(use generic type Object).

public static class Transmitter {
/**
* Capture all {@link TransmittableThreadLocal} and registered {@link ThreadLocal} values in the current thread.
*
* @return the captured {@link TransmittableThreadLocal} values
* @since 2.3.0
*/
@NonNull
public static Object capture() {

improve the type safety of transmitter

  • the input of replay should be constricted to the output of capture.
  • the input of restore should be constricted to the output of replay/clear.
@oldratlee
Copy link
Member Author

implemented in v3(developing)

@oldratlee oldratlee self-assigned this Sep 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant