/SJedis

Key-Value hover TCP/IP sockets

Primary LanguageJava

SJedis

Key-Value hover TCP/IP sockets

Requirements

To build SJedis, the following will need to be installed and available from your shell:

How to

Run SJedis-server

java -jar SJedis.jar <port> <password> 

Use SJedis Client

        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();

TODO

  • value with life time (time to live ttl)