파일 종속성

파일 종속성

응용 프로그램의 캐시에 있는 다른 개체에 대한 파일 종속성을 추적합니다.


건설자

# 새 파일 종속성(파일 이름, 시작 후)

변경 사항에 대해 파일 경로(파일 또는 디렉터리에 대한) 배열을 모니터링하고 변경 내용 추적을 시작할 시기를 나타내는 FileExpiration 클래스의 새 인스턴스를 초기화합니다.

매개 변수 :
이름 타입 기술설명
fileNames 반복 가능.

종속 파일 경로의 배열입니다.

startAfter 날짜

StartAfterTicks는 종속성이 시작될 때까지의 시간을 보여줍니다.

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

// Generate a json object of  customer
let customer = getCustomerObjuect();

// create CacheItem to with your desired object
let cacheItem = new ncache.CacheItem(customer, "Json");

// add file dependency to cacheItem
let fileDependency = new ncache.FileDependency("filePath");
cacheItem.setDependency(fileDependency);

// Adding item dependent on file 
await cache.add(customer.CustomerID, cacheItem);

//Any modification in the dependent file will cause invalidation of the dependent item.
   

행동 양식

# getFileNames() → {배열. }

파일 이름 배열 가져오기

반환 :
타입
정렬.

# getStartAfterTicks() → {번호}

틱 받기

반환 :
타입
번호

# (비동기) 초기화(파일 이름, 시작 후)

변경 사항에 대해 파일 경로(파일 또는 디렉터리에 대한) 배열을 모니터링하고 변경 내용 추적이 시작될 시기를 나타내는 FileExpiration을 초기화합니다.

매개 변수 :
이름 타입 기술설명
fileNames 반복 가능.

종속 파일 경로의 배열입니다.

startAfter 날짜

StartAfterTicks는 종속성이 시작될 때까지의 시간을 보여줍니다.