Lock 鎖
Semaphore 信號量
CountDownLatch 柵欄
遠程服務調(diào)用
Redisson 提供了一種遠程服務調(diào)用的方式。
RRemoteService remoteService = redisson.getRemoteService();
SomeServiceImpl someServiceImpl = new SomeServiceImpl();
// 注冊服務
// 同一時間只處理一個調(diào)用
remoteService.register(SomeServiceInterface.class, someServiceImpl);
// 設置可以并發(fā)調(diào)用的連接數(shù)
remoteService.register(SomeServiceInterface.class, someServiceImpl, 12);
RRemoteService remoteService = redisson.getRemoteService();
SomeServiceInterface service = remoteService.get(SomeServiceInterface.class);
String result = service.doSomeStuff(1L, "secondParam", new AnyParam());
可以注冊多個服務實例,對于服務調(diào)用,現(xiàn)在不清楚負載均衡等細節(jié)。
Live Object service
提供了各種查詢操作,可以當做類似文檔數(shù)據(jù)庫使用。
Distributed executor service
分布式 executor service ,相當于Java ExecutorService的分布式版本。在執(zhí)行分布式計算的時候很方便。