건설자
# 새로운 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);