C# Class NodeNetAsync.Db.Redis.RedisClient

Simple non-binary-safe Redis Async Client.
Afficher le fichier Open project: soywiz/NodeNetAsync Class Usage Examples

Protected Properties

Свойство Type Description
Encoding System.Text.Encoding
TcpClient NodeNetAsync.Net.TcpSocket

Méthodes publiques

Méthode Description
AppendAsync ( string Key, string Value ) : Task

Append a value to a key

O(1). The amortized time complexity is O(1) assuming the appended value is small and the already present value is of any size, since the dynamic string library used by Redis will double the free space available on every reallocation. If key already exists and is a string, this command appends the value at the end of the string. If key does not exist it is created and set as an empty string, so APPEND will be similar to SET in this special case.

AuthAsync ( string Password ) : Task

Authenticate to the server

Request for authentication in a password protected Redis server. Redis can be instructed to require a password before allowing clients to execute commands. This is done using the requirepass directive in the configuration file. If password matches the password in the configuration file, the server replies with the OK status code and starts accepting commands. Otherwise, an error is returned and the clients needs to try a new password. Note: because of the high performance nature of Redis, it is possible to try a lot of passwords in parallel in very short time, so make sure to generate a strong and very long password so that this attack is infeasible.

BackgroundRewriteAofAsync ( ) : System.Threading.Tasks.Task

Asynchronously rewrite the append-only file

Rewrites the append-only file to reflect the current dataset in memory. If BGREWRITEAOF fails, no data gets lost as the old AOF will be untouched.

BackgroundSave ( ) : System.Threading.Tasks.Task

Asynchronously save the dataset to disk

Save the DB in background. The OK code is immediately returned. Redis forks, the parent continues to server the clients, the child saves the DB on disk then exit. A client my be able to check if the operation succeeded using the LASTSAVE command.

CloseAsync ( ) : System.Threading.Tasks.Task

CommandAsync ( ) : Task

Sends a command to the redis server

CreateAndConnectAsync ( string Host, ushort Port = 6379, Encoding Encoding = null, string Password = null ) : Task

GetAsync ( string Key ) : Task

SetAsync ( string Key, string Value ) : System.Threading.Tasks.Task

Méthodes protégées

Méthode Description
ConnectAsync ( string Host, ushort Port = 6379, string Password = null ) : System.Threading.Tasks.Task

ReadValueAsync ( ) : Task

RedisClient ( Encoding Encoding = null ) : System

Method Details

AppendAsync() public méthode

Append a value to a key
O(1). The amortized time complexity is O(1) assuming the appended value is small and the already present value is of any size, since the dynamic string library used by Redis will double the free space available on every reallocation. If key already exists and is a string, this command appends the value at the end of the string. If key does not exist it is created and set as an empty string, so APPEND will be similar to SET in this special case.
public AppendAsync ( string Key, string Value ) : Task
Key string
Value string
Résultat Task

AuthAsync() public méthode

Authenticate to the server
Request for authentication in a password protected Redis server. Redis can be instructed to require a password before allowing clients to execute commands. This is done using the requirepass directive in the configuration file. If password matches the password in the configuration file, the server replies with the OK status code and starts accepting commands. Otherwise, an error is returned and the clients needs to try a new password. Note: because of the high performance nature of Redis, it is possible to try a lot of passwords in parallel in very short time, so make sure to generate a strong and very long password so that this attack is infeasible.
public AuthAsync ( string Password ) : Task
Password string
Résultat Task

BackgroundRewriteAofAsync() public méthode

Asynchronously rewrite the append-only file
Rewrites the append-only file to reflect the current dataset in memory. If BGREWRITEAOF fails, no data gets lost as the old AOF will be untouched.
public BackgroundRewriteAofAsync ( ) : System.Threading.Tasks.Task
Résultat System.Threading.Tasks.Task

BackgroundSave() public méthode

Asynchronously save the dataset to disk
Save the DB in background. The OK code is immediately returned. Redis forks, the parent continues to server the clients, the child saves the DB on disk then exit. A client my be able to check if the operation succeeded using the LASTSAVE command.
public BackgroundSave ( ) : System.Threading.Tasks.Task
Résultat System.Threading.Tasks.Task

CloseAsync() public méthode

public CloseAsync ( ) : System.Threading.Tasks.Task
Résultat System.Threading.Tasks.Task

CommandAsync() public méthode

Sends a command to the redis server
public CommandAsync ( ) : Task
Résultat Task

ConnectAsync() protected méthode

protected ConnectAsync ( string Host, ushort Port = 6379, string Password = null ) : System.Threading.Tasks.Task
Host string
Port ushort
Password string
Résultat System.Threading.Tasks.Task

CreateAndConnectAsync() static public méthode

static public CreateAndConnectAsync ( string Host, ushort Port = 6379, Encoding Encoding = null, string Password = null ) : Task
Host string
Port ushort
Encoding System.Text.Encoding
Password string
Résultat Task

GetAsync() public méthode

public GetAsync ( string Key ) : Task
Key string
Résultat Task

ReadValueAsync() protected méthode

protected ReadValueAsync ( ) : Task
Résultat Task

RedisClient() protected méthode

protected RedisClient ( Encoding Encoding = null ) : System
Encoding System.Text.Encoding
Résultat System

SetAsync() public méthode

public SetAsync ( string Key, string Value ) : System.Threading.Tasks.Task
Key string
Value string
Résultat System.Threading.Tasks.Task

Property Details

Encoding protected_oe property

protected Encoding,System.Text Encoding
Résultat System.Text.Encoding

TcpClient protected_oe property

protected TcpSocket,NodeNetAsync.Net TcpClient
Résultat NodeNetAsync.Net.TcpSocket