Discuss / Java / 草草看完了

草草看完了

Topic source

🌙

#1 Created at ... [Delete] [Delete and Lock User]

等后面,回头再细看,

有些东西等阅历上来了 回头再看就简单多了

🌙

#2 Created at ... [Delete] [Delete and Lock User]

今天状态不佳,换个章节看吧

小绿这章简单呀=-=

🌙

#4 Created at ... [Delete] [Delete and Lock User]

状态不行啊,就难啊,第一次看陌生的东西

用起来,简单,理解起来也不是很难,就是实现起来,有点费劲

有点像 spring 的ioc ,不同的是 这里需要我们自己去维护,对象,还不能忘记remove

🌙

#5 Created at ... [Delete] [Delete and Lock User]

好像理解错了 这是独立线程之间传递

🌙

#6 Created at ... [Delete] [Delete and Lock User]

void processUser(user) { try { threadLocalUser.set(user); step1(); step2(); } finally { threadLocalUser.remove(); }}

step1(); step2();的作用是什么

🌙

#7 Created at ... [Delete] [Delete and Lock User]

没啥用,示例代码,就是2个方法。

感觉可以使用redis 实现这个功能,不过网上好像都是2者结合使用

springboot使用redis和ThreadLocal做单点登录_weixin_34124939的博客-CSDN博客


  • 1

Reply