antirez / antirez/RESP3

Carification of attributes: arity, key uniquity, and permitted key types

Đang mở
#35 0 bình luận 1 reaction 0 người được giao Xem trên GitHub
Ngôn ngữ chính
Không có dữ liệu ngôn ngữ
Star
230
Fork
41
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Mô tả

Arity
---

For any (following) element, it seems clear that attributes can be omitted or present, but it isn't
explicit whether they can be repeated. For example, we know this is valid:

``` txt
|1
+ttl
:3600
:3
```

but is *this* valid

``` txt
|1
+ttl
:3600
|1
+priority
:7
:3
````

and if so (my personal preference would be "no, that isn't valid"), is it semantically identical to:

``` txt
|2
+ttl
:3600
+priority
:7
:3
````

or does it need to be possible to tell between the two scenarios?

---

Uniquity
---

How is the following to be interpreted?

``` txt
|2
+ttl
:3600
+ttl
:9001
:3
````

is this:

- illegal
- valid, last value wins (so: `ttl` = `9001`)
- valid, all values should be preserved (so: `ttl` = `[3600, 9001]` in some way)
- something else?

---

Permitted Key Types
---

(a lot of this may cross over into `map` more generally)

In a lot of platforms, it may be hard to reliably implement maps that can take arbitrary types as keys, as the equality semantics are very awkward. In reality, I can see a lot of clients would want to restrict handling to string-like types, as that is what most attributes are going to be keyed as. Now, sure, clients could choose to just treat all keys as blobs, but that has other problems.

As a pragmatic note, it may be sensible to consider whether it is actually required for attributes (and maps?) to allow keys that are, say, integers, doubles, big integers, in the case of attributes, it *might* even be prudent to limit it to simple strings, i.e. `+foo`

Hướng dẫn đóng góp

Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.