Skip to content
This repository has been archived by the owner on May 31, 2022. It is now read-only.

Why use invoke() instead of a method call for the same connection #1938

Open
wanlinus opened this issue Aug 30, 2021 · 0 comments
Open

Why use invoke() instead of a method call for the same connection #1938

wanlinus opened this issue Aug 30, 2021 · 0 comments

Comments

@wanlinus
Copy link

In this class org.springframework.security.oauth2.provider.token.store.redis.RedisTokenStore.storeAccessToken()
can use 'set()' method to set value , why use invoke() in same connection, What's the difference between them.I looked up a lot of information, but I couldn't find the answer. Can you tell me?

if (springDataRedis_2_0) {
	try {
		this.redisConnectionSet_2_0.invoke(conn, accessKey, serializedAccessToken);
		this.redisConnectionSet_2_0.invoke(conn, authKey, serializedAuth);
		this.redisConnectionSet_2_0.invoke(conn, authToAccessKey, serializedAccessToken);
	} catch (Exception ex) {
		throw new RuntimeException(ex);
	}
} else {
	conn.set(accessKey, serializedAccessToken);
	conn.set(authKey, serializedAuth);
	conn.set(authToAccessKey, serializedAccessToken);
}
@wanlinus wanlinus changed the title The same conn, use invoke()? Why use invoke() instead of a method call for the same connection Aug 30, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Development

No branches or pull requests

2 participants