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

TTL与ThreadPoolTaskExecutor的setTaskDecorator区别 #327

Closed
wpstan opened this issue Nov 17, 2021 · 1 comment
Closed

TTL与ThreadPoolTaskExecutor的setTaskDecorator区别 #327

wpstan opened this issue Nov 17, 2021 · 1 comment
Assignees
Labels
🔰 first nice issue 👍 ❓question Further information is requested

Comments

@wpstan
Copy link

wpstan commented Nov 17, 2021

spring线程池ThreadPoolTaskExecutor的setTaskDecorator方法可以对runnable进行装饰,也可以进行异步上下文数据传递。

请问一下,TTL相比ThreadPoolTaskExecutor的优点。

@oldratlee
Copy link
Member

oldratlee commented Nov 17, 2021

好处:透明且自动完成所有异步执行上下文的可定制、规范化的捕捉与传递。

展开说明参见 对应文档 使用TTL的好处与必要性

你看看是不是有回答你想了解的?欢迎继续讨论。 @wpstan

另外,可以看看

如果2种方式了解了、业务都能够用(现在、将来),就选一个落地起来(现在、将来)更简单的。


欢迎 反馈的你的使用场景实践 和 选型思考,大家可以了解与参考 @wpstan

@oldratlee oldratlee self-assigned this Nov 19, 2021
@oldratlee oldratlee added the ❓question Further information is requested label Nov 23, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🔰 first nice issue 👍 ❓question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants