PeanutButter
Loading...
Searching...
No Matches
PeanutButter.TempRedis.ITempRedis Interface Reference

Provides a temporary, disposable Redis instance levering off of a locally installed redis-server installation or binary within the path. More...

Inheritance diagram for PeanutButter.TempRedis.ITempRedis:
PeanutButter.TempRedis.TempRedis

Public Member Functions

IConnectionMultiplexer Connect ()
 Provides a simple mechanism to open a connection to the redis instance.
IConnectionMultiplexer Connect (ConfigurationOptions config)
 Connect to the redis instance with your own options.
IConnectionMultiplexer ConnectUnmanaged ()
 Provides a simple mechanism to connect to the redis instance with an unmanaged connection - you will be responsible for disposing of it.
IConnectionMultiplexer ConnectUnmanaged (ConfigurationOptions options)
 Provides a simple mechanism to connect to the redis instance with an unmanaged connection - you will be responsible for disposing of it.
void Start ()
 Starts up the server, if not auto-started at construction time (default is to auto-start)
void Stop ()
 Stops the redis server. You probably don't need to call this as the server will automatically be stopped when disposed.
void Restart ()
 Restarts the server process (shortcut for Stop/Start)
void Store< T > (string key, T value)
 Stores the value at the redis server.
Fetch< T > (string key)
 Attempts to fetch the value of the provided key.
string Fetch (string key)
 Attempts to fetch the value of the provided key.
bool TryFetch< T > (string key, out T result)
 Attempts to fetch the value of the provided key.
IDatabase ConnectAndSelectDatabase (int db)
 Creates a connection to the provided database.
IEnumerable< string > FetchKeys ()
 Fetch all keys at the default database.
IEnumerable< string > FetchKeys (string matching)
 Fetch all keys matching.
void FlushAll ()
 Flush all keys from the default database (0)
void Reset ()
 Close all managed connections, restart the server, flush all data.

Properties

int Port [get]
 The port this instance is listening on.
string RedisExecutable [get]
 The resolved path to redis-server (may be passed in as a constructor parameter if necessary)
RedisLocatorStrategies LocatorStrategies [get, set]
 The currently-used redis service locator strategies.
bool IsRunning [get]
 Flag: true when the redis server is running.
bool IsDisposed [get]
 Exposes the internal disposed flag for reading.
IDatabase DefaultDatabase [get]
 Database 0 - for simple store/retrieve operations.
int? ServerProcessId [get]
 When the server is running, this is an easy way to get at the PID; if you get null, it's not running.

Detailed Description

Provides a temporary, disposable Redis instance levering off of a locally installed redis-server installation or binary within the path.

Member Function Documentation

◆ Connect() [1/2]

IConnectionMultiplexer PeanutButter.TempRedis.ITempRedis.Connect ( )

Provides a simple mechanism to open a connection to the redis instance.

Returns

Implemented in PeanutButter.TempRedis.TempRedis.

◆ Connect() [2/2]

IConnectionMultiplexer PeanutButter.TempRedis.ITempRedis.Connect ( ConfigurationOptions config)

Connect to the redis instance with your own options.

Parameters
config
Returns

Implemented in PeanutButter.TempRedis.TempRedis.

◆ ConnectAndSelectDatabase()

IDatabase PeanutButter.TempRedis.ITempRedis.ConnectAndSelectDatabase ( int db)

Creates a connection to the provided database.

Parameters
db
Returns

Implemented in PeanutButter.TempRedis.TempRedis.

◆ ConnectUnmanaged() [1/2]

IConnectionMultiplexer PeanutButter.TempRedis.ITempRedis.ConnectUnmanaged ( )

Provides a simple mechanism to connect to the redis instance with an unmanaged connection - you will be responsible for disposing of it.

Returns

Implemented in PeanutButter.TempRedis.TempRedis.

◆ ConnectUnmanaged() [2/2]

IConnectionMultiplexer PeanutButter.TempRedis.ITempRedis.ConnectUnmanaged ( ConfigurationOptions options)

Provides a simple mechanism to connect to the redis instance with an unmanaged connection - you will be responsible for disposing of it.

Returns

Implemented in PeanutButter.TempRedis.TempRedis.

◆ Fetch()

string PeanutButter.TempRedis.ITempRedis.Fetch ( string key)

Attempts to fetch the value of the provided key.

  • will null if missing
  • shorthand for Fetch<string>(key)
Parameters
key

◆ Fetch< T >()

Attempts to fetch the value of the provided key.

  • will return default(T) if missing
Parameters
key
Template Parameters
T

◆ FetchKeys() [1/2]

IEnumerable< string > PeanutButter.TempRedis.ITempRedis.FetchKeys ( )

Fetch all keys at the default database.

Returns

Implemented in PeanutButter.TempRedis.TempRedis.

◆ FetchKeys() [2/2]

IEnumerable< string > PeanutButter.TempRedis.ITempRedis.FetchKeys ( string matching)

Fetch all keys matching.

Parameters
matching
Returns

Implemented in PeanutButter.TempRedis.TempRedis.

◆ Reset()

void PeanutButter.TempRedis.ITempRedis.Reset ( )

Close all managed connections, restart the server, flush all data.

Implemented in PeanutButter.TempRedis.TempRedis.

◆ Restart()

void PeanutButter.TempRedis.ITempRedis.Restart ( )

Restarts the server process (shortcut for Stop/Start)

Implemented in PeanutButter.TempRedis.TempRedis.

◆ Stop()

void PeanutButter.TempRedis.ITempRedis.Stop ( )

Stops the redis server. You probably don't need to call this as the server will automatically be stopped when disposed.

Implemented in PeanutButter.TempRedis.TempRedis.

◆ Store< T >()

void PeanutButter.TempRedis.ITempRedis.Store< T > ( string key,
T value )

Stores the value at the redis server.

Parameters
key
value
Template Parameters
T

◆ TryFetch< T >()

bool PeanutButter.TempRedis.ITempRedis.TryFetch< T > ( string key,
out T result )

Attempts to fetch the value of the provided key.

Parameters
key
result
Template Parameters
T
Returns

Property Documentation

◆ DefaultDatabase

IDatabase PeanutButter.TempRedis.ITempRedis.DefaultDatabase
get

Database 0 - for simple store/retrieve operations.

Implemented in PeanutButter.TempRedis.TempRedis.

◆ IsDisposed

bool PeanutButter.TempRedis.ITempRedis.IsDisposed
get

Exposes the internal disposed flag for reading.

Implemented in PeanutButter.TempRedis.TempRedis.

◆ IsRunning

bool PeanutButter.TempRedis.ITempRedis.IsRunning
get

Flag: true when the redis server is running.

Implemented in PeanutButter.TempRedis.TempRedis.

◆ LocatorStrategies

RedisLocatorStrategies PeanutButter.TempRedis.ITempRedis.LocatorStrategies
getset

The currently-used redis service locator strategies.

Implemented in PeanutButter.TempRedis.TempRedis.

◆ Port

int PeanutButter.TempRedis.ITempRedis.Port
get

The port this instance is listening on.

Implemented in PeanutButter.TempRedis.TempRedis.

◆ RedisExecutable

string PeanutButter.TempRedis.ITempRedis.RedisExecutable
get

The resolved path to redis-server (may be passed in as a constructor parameter if necessary)

Implemented in PeanutButter.TempRedis.TempRedis.

◆ ServerProcessId

int? PeanutButter.TempRedis.ITempRedis.ServerProcessId
get

When the server is running, this is an easy way to get at the PID; if you get null, it's not running.

Implemented in PeanutButter.TempRedis.TempRedis.


The documentation for this interface was generated from the following file:
  • source/TempDb/PeanutButter.TempRedis/TempRedis.cs