캐시 상태 이벤트 리스너

캐시 상태 이벤트 리스너

클러스터 수신기는 Clsuter와 관련된 이벤트를 수신합니다. memberJoined, memberLeft 이벤트와 같은.


건설자

# 새로운 CacheStatusEventListener(콜백)

매개 변수 :
이름 타입 기술설명
callback 기능

알림을 받았을 때 호출될 메소드

예시
const ncache  = require('ncache-client');

function myCacheStatusEventListener() {
 //...
}

//Initialize the Cache Cluster 
let cache = await ncache.CacheManager.getCache("demoCache");
 
let notificationService = await ncache.cache.getNotificationService();

//Create Cache Status Event Listener
 let listener = new ncache.CacheStatusEventListener(myCacheStatusEventListener);
 await notificationService.addCacheStatusEventListener(listener, ncache.CacheStatusNotificationType.CacheStopped);