antirez / antirez/RESP3

Additional "processing instruction" type

オープン
#17 コメント 2 件 リアクション 0 件 担当者 0 名 GitHub で見る
主要言語
言語のデータがありません
スター
230
フォーク
41
PR マージ指標
30日以内にマージされた PR はありません

説明

In a [project I've been hacking on](https://github.com/coleifer/greendb), a redis-like frontend for LMDB, I implemented and extended the Redis protocol with a few additional types.

One of these I think may interest you I'm calling a "processing instruction". It allows the client to send additional metadata along with a single command. Currently I am only using this functionality to allow the client to specify a different database for a single command (LMDB, like Redis, supports multiple databases within a single environment). So rather than having the client do:

* SELECT 0
* do some operation on db 0
* SELECT 15
* do some operation on db 15
* SELECT 0 -- reset the client state.

I can just explicitly SELECT 0 once, and when I need to run a single command against DB 15, I send (along with the command) a processing instruction that indicates the DB for that command should be db 15:

* do some operation on db 0
* (include processing instruction to use db 15) + do some operation on db 15
* do another operation on db 0

Another usage for processing commands could be to set/modify the expiration time on the key being operated on.

コントリビューションガイド

このリポジトリのコントリビューションガイドは索引されていません

評価

この issue はまだ評価されていません。

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。