StackExchange

StackExchange.Redis

#stackexch

ange.redis

Table of Contents

About

1

Chapter 1: Getting started with StackExchange.Redis

2

Remarks

2

Installing

2

Common Tasks

2

Versions

2

Examples

2

Basic Usage

2

Reuse Multiplexer Across Application

2

Configuration Options

3

Chapter 2: Keys and Values

Examples

4

4

Setting Values

4

Setting and getting an int

4

Chapter 3: Pipelining

Examples

Pipelining and Multiplexing

Chapter 4: Profiling

5

5

5

6

Remarks

6

Examples

6

Group all commands from set of threads together

6

Group commands based on issuing thread

7

Chapter 5: Publish Subscribe

9

Examples

9

Basics

9

Complex Data (JSON)

9

Complex Data (Protobuf)

Chapter 6: Scan

10

12

Syntax

12

Parameters

12

Remarks

12

Examples

12

Basic scanning of all keys on server

12

Iterating using a cursor

12

Credits

14

About

You can share this PDF with anyone you feel could benefit from it, downloaded the latest version

from: stackexchange-redis

It is an unofficial and free StackExchange.Redis ebook created for educational purposes. All the

content is extracted from Stack Overflow Documentation, which is written by many hardworking

individuals at Stack Overflow. It is neither affiliated with Stack Overflow nor official

StackExchange.Redis.

The content is released under Creative Commons BY-SA, and the list of contributors to each

chapter are provided in the credits section at the end of this book. Images may be copyright of

their respective owners unless otherwise specified. All trademarks and registered trademarks are

the property of their respective company owners.

Use the content presented in this book at your own risk; it is not guaranteed to be correct nor

accurate, please send your feedback and corrections to info@



1

Chapter 1: Getting started with

StackExchange.Redis

Remarks

Installing

Binaries for StackExchange.Redis are available on Nuget, and the source is available on Github.

Common Tasks

? Profiling

Versions

Version

Release Date

1.0.187

2014-03-18

Examples

Basic Usage

using StackExchange.Redis;

// ...

// connect to the server

ConnectionMultiplexer connection = ConnectionMultiplexer.Connect("localhost");

// select a database (by default, DB = 0)

IDatabase db = connection.GetDatabase();

// run a command, in this case a GET

RedisValue myVal = db.StringGet("mykey");

Reuse Multiplexer Across Application

class Program

{

private static Lazy _multiplexer =

new Lazy(

() => ConnectionMultiplexer.Connect("localhost"),

LazyThreadSafetyMode.ExecutionAndPublication);

static void Main(string[] args)



2

................
................

In order to avoid copyright disputes, this page is only a partial summary.

Google Online Preview   Download