첨부 실행 코드는 나눔고딕코딩 폰트를 사용합니다.
------------------------------------------------------------------------------------------------------------------------------------------------------
728x90
728x170

■ ConnectionMultiplexer 클래스를 사용해 재사용하는 방법을 보여준다.

 

▶ 예제 코드 (C#)

using System;
using System.Threading;

using StackExchange.Redis;

Lazy<ConnectionMultiplexer> multiplexerLazy = new Lazy<ConnectionMultiplexer>
(
    () => ConnectionMultiplexer.Connect("192.168.29.197:6380"),
    LazyThreadSafetyMode.ExecutionAndPublication
);

IDatabase database1 = multiplexerLazy.Value.GetDatabase(1);
IDatabase database2 = multiplexerLazy.Value.GetDatabase(2);

※ 패키지 설치 : StackExchange.Redis

728x90
그리드형(광고전용)
Posted by icodebroker
,