PeanutButter
|
Public Member Functions | |||
IConnectionMultiplexer | Connect () | ||
Provides a simple mechanism to open a connection to the redis instance.
| |||
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 | Reset () | ||
Close all managed connections, restart the server, flush all data. | |||
IConnectionMultiplexer | Connect (ConfigurationOptions options) | ||
Connect to the redis instance with your own options.
| |||
TempRedis () | |||
Constructs an instance of the temporary server, automatically started up and using redis-server as found in your PATH or via Windows service registry, where applicable; will attempt to download redis server on a windows host if not found in your path or as a service. | |||
TempRedis (TempRedisOptions options) | |||
Construct an instance of the temporary server. | |||
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) | |||
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.
| |||
Public Member Functions inherited from PeanutButter.TempRedis.ITempRedis | |||
void | Start () | ||
Starts up the server, if not auto-started at construction time (default is to auto-start) | |||
void | Store< T > (string key, T value) | ||
Stores the value at the redis server. | |||
T | 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. | |||
void | FlushAll () | ||
Flush all keys from the default database (0) |
Properties | |
Process | ServerProcess [get] |
For diagnostic purposes: monitor the actual server process. | |
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. | |
bool | ServerProcessIsRunning [get] |
Test if the server process is running. If we're in the middle of a restart, it's possible to get the exception "No process is associated with this object" when attempting to read HasExited off of the exposed ServerProcess. | |
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) | |
bool | IsRunning [get] |
Flag: true when the redis server is running. | |
bool | IsDisposed [get] |
Exposes the internal disposed flag for reading. | |
static int | DefaultConnectTimeoutMilliseconds = 2000 [get, set] |
Sets the default connect timeout for new instances of TempRedis.Connect() (2000) | |
static int | DefaultConnectRetry = 15 [get, set] |
Sets the default connect retry count for new instances of TempRedis.Connect() (15) | |
static int | DefaultAsyncTimeoutMilliseconds = 2000 [get, set] |
Sets the default async timeout for new instances of TempRedis.Connect() (2000) | |
static int | DefaultSyncTimeoutMilliseconds = 2000 [get, set] |
Sets the default sync timeout for new instances of TempRedis.Connect() (2000) | |
RedisLocatorStrategies | LocatorStrategies [get, set] |
Possible strategies for locating a redis server executable. | |
IDatabase | DefaultDatabase [get] |
Database 0 - for simple store/retrieve operations. | |
IConnectionMultiplexer | DefaultConnection [get] |
The default connection used for operations. |
PeanutButter.TempRedis.TempRedis.TempRedis | ( | TempRedisOptions | options | ) |
Construct an instance of the temporary server.
options |
IConnectionMultiplexer PeanutButter.TempRedis.TempRedis.Connect | ( | ) |
Provides a simple mechanism to open a connection to the redis instance.
Implements PeanutButter.TempRedis.ITempRedis.
IConnectionMultiplexer PeanutButter.TempRedis.TempRedis.Connect | ( | ConfigurationOptions | options | ) |
Connect to the redis instance with your own options.
config |
Implements PeanutButter.TempRedis.ITempRedis.
IDatabase PeanutButter.TempRedis.TempRedis.ConnectAndSelectDatabase | ( | int | db | ) |
Creates a connection to the provided database.
db |
Implements PeanutButter.TempRedis.ITempRedis.
IConnectionMultiplexer PeanutButter.TempRedis.TempRedis.ConnectUnmanaged | ( | ) |
Provides a simple mechanism to connect to the redis instance with an unmanaged connection - you will be responsible for disposing of it.
Implements PeanutButter.TempRedis.ITempRedis.
IConnectionMultiplexer PeanutButter.TempRedis.TempRedis.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.
Implements PeanutButter.TempRedis.ITempRedis.
IEnumerable< string > PeanutButter.TempRedis.TempRedis.FetchKeys | ( | ) |
IEnumerable< string > PeanutButter.TempRedis.TempRedis.FetchKeys | ( | string | matching | ) |
void PeanutButter.TempRedis.TempRedis.Reset | ( | ) |
Close all managed connections, restart the server, flush all data.
Implements PeanutButter.TempRedis.ITempRedis.
void PeanutButter.TempRedis.TempRedis.Restart | ( | ) |
Restarts the server process (shortcut for Stop/Start)
Implements PeanutButter.TempRedis.ITempRedis.
void PeanutButter.TempRedis.TempRedis.Stop | ( | ) |
Stops the redis server. You probably don't need to call this as the server will automatically be stopped when disposed.
Implements PeanutButter.TempRedis.ITempRedis.
|
get |
Database 0 - for simple store/retrieve operations.
Implements PeanutButter.TempRedis.ITempRedis.
|
get |
Exposes the internal disposed flag for reading.
Implements PeanutButter.TempRedis.ITempRedis.
|
get |
Flag: true when the redis server is running.
Implements PeanutButter.TempRedis.ITempRedis.
|
getset |
Possible strategies for locating a redis server executable.
Implements PeanutButter.TempRedis.ITempRedis.
|
get |
The port this instance is listening on.
Implements PeanutButter.TempRedis.ITempRedis.
|
get |
The resolved path to redis-server (may be passed in as a constructor parameter if necessary)
Implements PeanutButter.TempRedis.ITempRedis.
|
get |
When the server is running, this is an easy way to get at the PID; if you get null, it's not running.
Implements PeanutButter.TempRedis.ITempRedis.