Class RedisAPI
java.lang.Object
com.kamikazejam.kamicommon.redis.RedisAPI
The handle for one Redis connection, exposing pub/sub channels alongside Lettuce's synchronous and
asynchronous command interfaces. Obtain one from
RedisConnector.getAPI(com.kamikazejam.kamicommon.redis.util.RedisConf); the constructor is not
public, and every caller passing an equal RedisConf receives the same shared instance. shutdown() releases this caller's claim rather
than closing the connection, and once the last holder has released it this instance is spent.- See Also:
-
Method Summary
Modifier and TypeMethodDescriptiongetState()boolean@NotNull RedisChannelregisterChannel(@NotNull String channel) @NotNull RedisMultiChannelregisterMultiChannel(@NotNull String... channels) voidshutdown()Releases this caller's claim on the underlying Redis connection.
-
Method Details
-
shutdown
public void shutdown()Releases this caller's claim on the underlying Redis connection.Instances are shared: every caller passing an equal
RedisConfreceives the same object. The connection is closed once the last holder has called this, so a plugin shutting down no longer takes the connection away from anything else in the same JVM.Once the connection really is closed, this instance is spent. Call
RedisConnector.getAPI(com.kamikazejam.kamicommon.redis.util.RedisConf)again for a fresh one rather than reusing this reference. -
registerChannel
-
registerMultiChannel
@NotNull public @NotNull RedisMultiChannel registerMultiChannel(@NotNull @NotNull String... channels) -
getCmdsSync
-
getCmdsAsync
-
getConnection
-
getState
-
isConnected
public boolean isConnected()
-