未验证 提交 e9043d92 编写于 作者: N Nikita Koksharov 提交者: GitHub

Update README.md

上级 d172c326
......@@ -114,16 +114,48 @@ Used by
```java
// 1. Create config object
Config = ...
Config config = new Config();
config.useClusterServers()
// use "rediss://" for SSL connection
.addNodeAddress("redis://127.0.0.1:7181");
// or read config from file
config = Config.fromYAML(new File("config-file.yaml"));
```
```java
// 2. Create Redisson instance
// Sync and Async API
RedissonClient redisson = Redisson.create(config);
// 3. Get Redis based object or service you need
// Reactive API
RedissonReactiveClient redissonReactive = Redisson.createReactive(config);
// RxJava2 API
RedissonRxClient redissonRx = Redisson.createRx(config);
```
```java
// 3. Get Redis based Map
RMap<MyKey, MyValue> map = redisson.getMap("myMap");
RMapReactive<MyKey, MyValue> mapReactive = redissonReactive.getMap("myMap");
RMapRx<MyKey, MyValue> mapRx = redissonRx.getMap("myMap");
```
```java
// 4. Get Redis based Lock
RLock lock = redisson.getLock("myLock");
RLockReactive lockReactive = redissonReactive.getLock("myLock");
RLockRx lockRx = redissonRx.getLock("myLock");
```
```java
// 4. Get Redis based ExecutorService
RExecutorService executor = redisson.getExecutorService("myExecutorService");
// over 30 different Redis based objects and services ...
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册