Key-Value hover TCP/IP sockets
To build SJedis, the following will need to be installed and available from your shell:
java -jar SJedis.jar <port> <password>
SJedis jedis = SJedis.builder()
.host("127.0.0.1")
.port(1234)
.password("1234").build();
jedis.connect().thenCompose(connection -> {
connection.set(
new String[]{"hello", "salut"}
new Object[]{"salut", "hello"}
);
return connection.get(
"hello",
"salut",
"holla"
);
}).thenAccept(response -> {
System.out.println(Arrays.toString(response.toArray()));
response.getConnection().close();
}).whenComplete((unused, throwable) -> {
if (throwable != null) throwable.printStackTrace();
}).join();
- value with life time (time to live ttl)