메서드 CreateQueue
큐 생성 (끈)
제공된 컬렉션 이름에 대해 분산 대기열을 생성합니다.
선언
IDistributedQueue<T> CreateQueue<T>(string key)
파라미터
| 타입 | 이름 | 기술설명 |
|---|---|---|
| 시스템.문자열 | 키 | 생성할 컬렉션의 이름입니다. |
반품
| 타입 | 기술설명 |
|---|---|
| IDistributedQueue | Queue를 사용하기 위한 인터페이스입니다. |
유형 매개변수
| 이름 | 기술설명 |
|---|---|
| T | 대기열 항목의 유형입니다. |
예
다음 코드 샘플은 분산 대기열을 생성하는 방법을 보여줍니다.
ICache cache = CacheManager.GetCache("demoClusteredCache");
string dataTypeName = "DistributedQueue";
IDistributedQueue<Product> queue = cache.DataTypeManager.CreateQueue<Product>(dataTypeName);
큐 생성 (문자열, DataTypeAttributes, WriteThruOptions)
제공된 컬렉션 이름에 대해 분산 대기열을 생성하고 컬렉션의 속성으로 제공된 사용자 구성에 따라 이를 구성합니다.
선언
IDistributedQueue<T> CreateQueue<T>(string key, DataTypeAttributes attributes, WriteThruOptions options = null)
파라미터
| 타입 | 이름 | 기술설명 |
|---|---|---|
| 시스템.문자열 | 키 | 생성할 컬렉션의 이름 |
| 데이터 유형 속성 | 속성 | 데이터 유형 속성 이 컬렉션에 대한 사용자 구성을 제공합니다. |
| 쓰기 옵션 | 옵션 | 쓰기 옵션 데이터 소스 업데이트에 관해 WriteThru, WriteBehind 또는 없음일 수 있습니다. |
반품
| 타입 | 기술설명 |
|---|---|
| IDistributedQueue | Queue를 사용하기 위한 인터페이스입니다. |
유형 매개변수
| 이름 | 기술설명 |
|---|---|
| T | 대기열 항목의 유형입니다. |
예
다음 코드 샘플은 절대 만료 시간이 1분인 분산 대기열을 생성하는 방법을 보여줍니다.
ICache cache = CacheManager.GetCache("demoClusteredCache");
string dataTypeName = "DistributedQueue";
DataTypeAttributes attributes = new DataTypeAttributes();
attributes.Expiration = new Expiration(ExpirationType.Absolute, new TimeSpan(0, 1, 0));
IDistributedQueue<Product> queue = cache.DataTypeManager.CreateQueue<Product>(dataTypeName, attributes);