What is ConnectionMultiplexer?

 Posted by Rajnilari2015 on 10/25/2016 | Category: NoSql Interview questions | Views: 4820 | Points: 40
Answer:

The connection to Redis is handled by the ConnectionMultiplexer class which is the central object in the StackExchange.Redis namespace. The ConnectionMultiplexer is designed to be shared and reused between callers.

e.g.

static IDatabase GetRedisInstance()

{
return
ConnectionMultiplexer
.Connect("localhost")
.GetDatabase();
}


The GetDatabase() of the ConnectionMultiplexer sealed class obtains an interactive connection to a database inside redis.


Asked In: Many Interviews | Alert Moderator 

Comments or Responses

Login to post response