Java Code Examples for io.lettuce.core.api.async.RedisAsyncCommands#hgetall()
The following examples show how to use
io.lettuce.core.api.async.RedisAsyncCommands#hgetall() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: LettuceIntegrationLiveTest.java From tutorials with MIT License | 7 votes |
@Test public void givenValues_thenSaveAsRedisHashAsync() throws Exception { RedisAsyncCommands<String, String> asyncCommands = redisConnection.async(); String recordName = "record1"; String name = "FirstName"; String value = "John"; String surname = "LastName"; String value1 = "Smith"; asyncCommands.hset(recordName, name, value); asyncCommands.hset(recordName, surname, value1); RedisFuture<Map<String, String>> redisFuture = asyncCommands.hgetall(recordName); Map<String, String> record = redisFuture.get(); Assert.assertEquals(record.get(name), value); Assert.assertEquals(record.get(surname), value1); }
Example 2
Source File: RedisSources.java From hazelcast-jet-contrib with Apache License 2.0 | 5 votes |
HashContext( RedisURI uri, K hash, SupplierEx<RedisCodec<K, V>> codecSupplier, FunctionEx<Map.Entry<K, V>, T> mapFn ) { this.client = RedisClient.create(uri); this.connection = client.connect(codecSupplier.get()); this.mapFn = mapFn; RedisAsyncCommands<K, V> commands = connection.async(); this.commandFuture = commands.hgetall(this, hash); }