C# Класс NodeNetAsync.Db.Redis.RedisClient

Simple non-binary-safe Redis Async Client.
Показать файл Открыть проект Примеры использования класса

Защищенные свойства (Protected)

Свойство Тип Описание
Encoding System.Text.Encoding
TcpClient NodeNetAsync.Net.TcpSocket

Открытые методы

Метод Описание
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

Защищенные методы

Метод Описание
ConnectAsync ( string Host, ushort Port = 6379, string Password = null ) : System.Threading.Tasks.Task

ReadValueAsync ( ) : Task

RedisClient ( Encoding Encoding = null ) : System

Описание методов

AppendAsync() публичный Метод

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
Результат Task

AuthAsync() публичный Метод

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
Результат Task

BackgroundRewriteAofAsync() публичный Метод

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
Результат System.Threading.Tasks.Task

BackgroundSave() публичный Метод

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
Результат System.Threading.Tasks.Task

CloseAsync() публичный Метод

public CloseAsync ( ) : System.Threading.Tasks.Task
Результат System.Threading.Tasks.Task

CommandAsync() публичный Метод

Sends a command to the redis server
public CommandAsync ( ) : Task
Результат Task

ConnectAsync() защищенный Метод

protected ConnectAsync ( string Host, ushort Port = 6379, string Password = null ) : System.Threading.Tasks.Task
Host string
Port ushort
Password string
Результат System.Threading.Tasks.Task

CreateAndConnectAsync() статический публичный Метод

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
Результат Task

GetAsync() публичный Метод

public GetAsync ( string Key ) : Task
Key string
Результат Task

ReadValueAsync() защищенный Метод

protected ReadValueAsync ( ) : Task
Результат Task

RedisClient() защищенный Метод

protected RedisClient ( Encoding Encoding = null ) : System
Encoding System.Text.Encoding
Результат System

SetAsync() публичный Метод

public SetAsync ( string Key, string Value ) : System.Threading.Tasks.Task
Key string
Value string
Результат System.Threading.Tasks.Task

Описание свойств

Encoding защищенное свойство

protected Encoding,System.Text Encoding
Результат System.Text.Encoding

TcpClient защищенное свойство

protected TcpSocket,NodeNetAsync.Net TcpClient
Результат NodeNetAsync.Net.TcpSocket