使用redis的时候只需要在初始化的时候定义一个全局的客户端吗?还是每次请求都要重新new一个客户端?我的意思的是在多线程下会不会出问题?
认证0级讲师
You can use a ConnectionPool to manage redis connections.
No, Redis is single-threaded, so no matter how many connections your program has to Redis, Redis will handle these requests in a single thread.
You can use a ConnectionPool to manage redis connections.
No, Redis is single-threaded, so no matter how many connections your program has to Redis, Redis will handle these requests in a single thread.