bend-kit-redis Releases (6): 0.3.0.0 0x722298938e2241d314783699716672cb indexed https://jend.leeeet.dev/files.txt?path=bend-kit-redis@0.3.0.0 0.2.0.1 0x3bc30dd7588bcfd43c5515b83f981c27 unindexed https://jend.leeeet.dev/files.txt?path=bend-kit-redis@0.2.0.1 0.2.0.0 0xe19ca060a437acd0d1970a44d51ba18e unindexed https://jend.leeeet.dev/files.txt?path=bend-kit-redis@0.2.0.0 0.1.0.2 0xae0449f4d22509013aa9b43b915c9d80 unindexed https://jend.leeeet.dev/files.txt?path=bend-kit-redis@0.1.0.2 0.1.0.1 0xd43628b5f4e12308da1f0d749d882397 unindexed https://jend.leeeet.dev/files.txt?path=bend-kit-redis@0.1.0.1 0.1.0.0 0x24dc4beaaf2be48430ae7d5ece604448 unindexed https://jend.leeeet.dev/files.txt?path=bend-kit-redis@0.1.0.0 Definitions (150, 1 to 100 shown): Redis.Val (https://jend.leeeet.dev/definition.txt?path=bend-kit-redis@0.3.0.0/redis.bend&name=Val) # A RESP3 value (RESP2 replies decode into the same type). Text fields hold the raw # bytes of the line. Dict (a RESP3 map) and Attr keep their pairs flat, key then value, as # on the wire and in hiredis. Attr holds the attribute pairs, then the reply they annotate, last. # Int is a signed 64-bit integer as two's-complement words. type Val is Type: Simple{text: Bytes.Bytes} Error{text: Bytes.Bytes} Int{hi: U32, lo: U32} Bulk{data: Bytes.Bytes} Arr{items: List<&1, Val>} Null{} … Redis.kind.tag (https://jend.leeeet.dev/definition.txt?path=bend-kit-redis@0.3.0.0/redis.bend&name=kind.tag) # Aggregate kinds, in the order of their type bytes below. def kind.tag(+kind: U32) -> String: Redis.kind.val (https://jend.leeeet.dev/definition.txt?path=bend-kit-redis@0.3.0.0/redis.bend&name=kind.val) def kind.val(+kind: U32, xs: List<&1, Val>) -> Val: Redis.i64.neg (https://jend.leeeet.dev/definition.txt?path=bend-kit-redis@0.3.0.0/redis.bend&name=i64.neg) def i64.neg(+hi: U32, +lo: U32) -> U32 & U32: Redis.u64.div10 (https://jend.leeeet.dev/definition.txt?path=bend-kit-redis@0.3.0.0/redis.bend&name=u64.div10) # The 64-bit (hi, lo) divided by 10, and the remainder, over 16-bit limbs. def u64.div10(+hi: U32, +lo: U32) -> U32 & U32 & U32: Redis.digit.put (https://jend.leeeet.dev/definition.txt?path=bend-kit-redis@0.3.0.0/redis.bend&name=digit.put) def digit.put(z: Bool, +r: U32, acc: String) -> String: Redis.u64.show.go (https://jend.leeeet.dev/definition.txt?path=bend-kit-redis@0.3.0.0/redis.bend&name=u64.show.go) # z is set once the value left to print is zero; 20 digits hold any u64. def u64.show.go(f: Nat, q: U32 & U32 & U32, acc: String, +z: Bool) -> String: Redis.u64.show (https://jend.leeeet.dev/definition.txt?path=bend-kit-redis@0.3.0.0/redis.bend&name=u64.show) def u64.show(+hi: U32, +lo: U32) -> String: Redis.i64.show.of (https://jend.leeeet.dev/definition.txt?path=bend-kit-redis@0.3.0.0/redis.bend&name=i64.show.of) def i64.show.of(r: U32 & U32, neg: Bool) -> String: Redis.i64.show (https://jend.leeeet.dev/definition.txt?path=bend-kit-redis@0.3.0.0/redis.bend&name=i64.show) def i64.show(+hi: U32, +lo: U32) -> String: Redis.E (https://jend.leeeet.dev/definition.txt?path=bend-kit-redis@0.3.0.0/redis.bend&name=E) # The output so far, whether every value had a RESP form, and the count of values written. type E is Type: E{o: Bytes.Bytes, ok: Bool, n: U32} Redis.fresh (https://jend.leeeet.dev/definition.txt?path=bend-kit-redis@0.3.0.0/redis.bend&name=fresh) def fresh() -> E: Redis.text (https://jend.leeeet.dev/definition.txt?path=bend-kit-redis@0.3.0.0/redis.bend&name=text) def text(+s: String) -> Bytes.Bytes: Redis.none (https://jend.leeeet.dev/definition.txt?path=bend-kit-redis@0.3.0.0/redis.bend&name=none) def none(m: Maybe<&2, U32>) -> Bool: Redis.clean.lf (https://jend.leeeet.dev/definition.txt?path=bend-kit-redis@0.3.0.0/redis.bend&name=clean.lf) def clean.lf(+cr: Bool, r: Bytes.Bytes & Maybe<&2, U32>) -> Bytes.Bytes & Bool: Redis.clean.cr (https://jend.leeeet.dev/definition.txt?path=bend-kit-redis@0.3.0.0/redis.bend&name=clean.cr) def clean.cr(r: Bytes.Bytes & Maybe<&2, U32>) -> Bytes.Bytes & Bool: Redis.clean (https://jend.leeeet.dev/definition.txt?path=bend-kit-redis@0.3.0.0/redis.bend&name=clean) # A line has no CR and no LF. def clean(t: Bytes.Bytes) -> Bytes.Bytes & Bool: Redis.put (https://jend.leeeet.dev/definition.txt?path=bend-kit-redis@0.3.0.0/redis.bend&name=put) def put(st: E, +head: String, body: Bytes.Bytes, +good: Bool) -> E: Redis.line (https://jend.leeeet.dev/definition.txt?path=bend-kit-redis@0.3.0.0/redis.bend&name=line) def line(st: E, +tag: String, r: Bytes.Bytes & Bool) -> E: Redis.blob (https://jend.leeeet.dev/definition.txt?path=bend-kit-redis@0.3.0.0/redis.bend&name=blob) def blob(st: E, +tag: String, b: Bytes.Bytes) -> E: Redis.verbatim.of (https://jend.leeeet.dev/definition.txt?path=bend-kit-redis@0.3.0.0/redis.bend&name=verbatim.of) def verbatim.of(st: E, +tl: U32, r: Bytes.Bytes & U32, t: Bytes.Bytes) -> E: Redis.verbatim (https://jend.leeeet.dev/definition.txt?path=bend-kit-redis@0.3.0.0/redis.bend&name=verbatim) def verbatim(st: E, f: Bytes.Bytes, t: Bytes.Bytes) -> E: Redis.agg.count (https://jend.leeeet.dev/definition.txt?path=bend-kit-redis@0.3.0.0/redis.bend&name=agg.count) # Maps count pairs and need an even count; Attr needs its pairs and one reply. def agg.count(+kind: U32, +n: U32) -> U32: Redis.agg.ok (https://jend.leeeet.dev/definition.txt?path=bend-kit-redis@0.3.0.0/redis.bend&name=agg.ok) def agg.ok(+kind: U32, +n: U32) -> Bool: Redis.agg (https://jend.leeeet.dev/definition.txt?path=bend-kit-redis@0.3.0.0/redis.bend&name=agg) def agg(st: E, +kind: U32, sub: E) -> E: Redis.boolean (https://jend.leeeet.dev/definition.txt?path=bend-kit-redis@0.3.0.0/redis.bend&name=boolean) def boolean(v: Bool) -> String: Redis.enc (https://jend.leeeet.dev/definition.txt?path=bend-kit-redis@0.3.0.0/redis.bend&name=enc) def enc(xs: List<&1, Val>, st: E) -> E: Redis.encode.done (https://jend.leeeet.dev/definition.txt?path=bend-kit-redis@0.3.0.0/redis.bend&name=encode.done) def encode.done(st: E) -> Maybe<&1, Bytes.Bytes>: Redis.encode (https://jend.leeeet.dev/definition.txt?path=bend-kit-redis@0.3.0.0/redis.bend&name=encode) # None when a line value holds CR or LF, a Dict has an odd item count, an Attr an even # one, or a Verbatim format is not 3 bytes. def encode(v: Val) -> Maybe<&1, Bytes.Bytes>: Redis.bulks (https://jend.leeeet.dev/definition.txt?path=bend-kit-redis@0.3.0.0/redis.bend&name=bulks) def bulks(xs: List<&1, Bytes.Bytes>) -> List<&1, Val>: Redis.encode.command.done (https://jend.leeeet.dev/definition.txt?path=bend-kit-redis@0.3.0.0/redis.bend&name=encode.command.done) def encode.command.done(st: E) -> Bytes.Bytes: Redis.encode.command (https://jend.leeeet.dev/definition.txt?path=bend-kit-redis@0.3.0.0/redis.bend&name=encode.command) # A command as a RESP array of bulk strings, the form every server accepts. def encode.command(args: List<&1, Bytes.Bytes>) -> Bytes.Bytes: Redis.args (https://jend.leeeet.dev/definition.txt?path=bend-kit-redis@0.3.0.0/redis.bend&name=args) # Byte-string arguments (one Char per octet) as Bytes. def args(xs: List<&2, String>) -> List<&1, Bytes.Bytes>: Redis.Num (https://jend.leeeet.dev/definition.txt?path=bend-kit-redis@0.3.0.0/redis.bend&name=Num) # A decimal line: sign, magnitude words, and whether it has 1 to 19 digits. type Num is Data: Num{neg: Bool, hi: U32, lo: U32, ok: Bool} Redis.num.go (https://jend.leeeet.dev/definition.txt?path=bend-kit-redis@0.3.0.0/redis.bend&name=num.go) # n digits from i: (hi, lo) = (hi, lo) * 10 + d over 16-bit limbs. 19 digits stay below 2^64. def num.go(n: Nat, r: Array & U32, +i: U32, +hi: U32, +lo: U32, +ok: Bool) -> Array & U32 & U32 & Bool: Redis.num.fin (https://jend.leeeet.dev/definition.txt?path=bend-kit-redis@0.3.0.0/redis.bend&name=num.fin) def num.fin(+neg: Bool, +len: U32, r: Array & U32 & U32 & Bool) -> Bytes.Bytes & Num: Redis.num.digits (https://jend.leeeet.dev/definition.txt?path=bend-kit-redis@0.3.0.0/redis.bend&name=num.digits) def num.digits(+neg: Bool, a: Array, +len: U32, +s: U32, +e: U32) -> Bytes.Bytes & Num: Redis.num.sign (https://jend.leeeet.dev/definition.txt?path=bend-kit-redis@0.3.0.0/redis.bend&name=num.sign) def num.sign(+len: U32, +s: U32, +e: U32, r: Array & U32) -> Bytes.Bytes & Num: Redis.num (https://jend.leeeet.dev/definition.txt?path=bend-kit-redis@0.3.0.0/redis.bend&name=num) # Bytes s until e, which are before len. def num(b: Bytes.Bytes, +s: U32, +e: U32) -> Bytes.Bytes & Num: Redis.int.mk (https://jend.leeeet.dev/definition.txt?path=bend-kit-redis@0.3.0.0/redis.bend&name=int.mk) def int.mk(r: U32 & U32) -> Val: Redis.int.val (https://jend.leeeet.dev/definition.txt?path=bend-kit-redis@0.3.0.0/redis.bend&name=int.val) def int.val(good: Bool, +neg: Bool, +hi: U32, +lo: U32) -> Maybe<&1, Val>: Redis.int.of (https://jend.leeeet.dev/definition.txt?path=bend-kit-redis@0.3.0.0/redis.bend&name=int.of) # RESP integers are signed 64-bit: the magnitude may reach 2^63 only when negative. def int.of(n: Num) -> Maybe<&1, Val>: Redis.len.of (https://jend.leeeet.dev/definition.txt?path=bend-kit-redis@0.3.0.0/redis.bend&name=len.of) # A length or count below 2^31; -1 (RESP2 null) is 4294967295 and anything else is 4294967294. def len.of(n: Num) -> U32: Redis.Frame (https://jend.leeeet.dev/definition.txt?path=bend-kit-redis@0.3.0.0/redis.bend&name=Frame) # An open aggregate: its kind, the items still due, and the items so far, reversed. type Frame is Type: Frame{kind: U32, left: U32, xs: List<&1, Val>} Redis.St (https://jend.leeeet.dev/definition.txt?path=bend-kit-redis@0.3.0.0/redis.bend&name=St) type St is Type: SHead{i: U32, stack: List<&1, Frame>} SDone{v: Val, i: U32, stack: List<&1, Frame>} SOk{v: Val, i: U32} SMore{} SBad{} Redis.Step (https://jend.leeeet.dev/definition.txt?path=bend-kit-redis@0.3.0.0/redis.bend&name=Step) # One reply and the index after it; More when the bytes end first; Bad when they cannot start a reply. type Step is Type: Reply{v: Val, next: U32} More{} Bad{} Redis.byte.of (https://jend.leeeet.dev/definition.txt?path=bend-kit-redis@0.3.0.0/redis.bend&name=byte.of) def byte.of(r: Bytes.Bytes & Maybe<&2, U32>) -> Bytes.Bytes & U32: Redis.byte (https://jend.leeeet.dev/definition.txt?path=bend-kit-redis@0.3.0.0/redis.bend&name=byte) # Byte i, or 256 past the end. def byte(b: Bytes.Bytes, +i: U32) -> Bytes.Bytes & U32: Redis.known (https://jend.leeeet.dev/definition.txt?path=bend-kit-redis@0.3.0.0/redis.bend&name=known) def known(+t: U32) -> Bool: Redis.null.st (https://jend.leeeet.dev/definition.txt?path=bend-kit-redis@0.3.0.0/redis.bend&name=null.st) def null.st(ok: Bool, +next: U32, stack: List<&1, Frame>) -> St: Redis.line.val (https://jend.leeeet.dev/definition.txt?path=bend-kit-redis@0.3.0.0/redis.bend&name=line.val) def line.val(+k: U32, t: Bytes.Bytes) -> Val: Redis.line.st (https://jend.leeeet.dev/definition.txt?path=bend-kit-redis@0.3.0.0/redis.bend&name=line.st) def line.st(+k: U32, +next: U32, stack: List<&1, Frame>, r: Bytes.Bytes & Bytes.Bytes) -> Bytes.Bytes & St: Redis.int.done (https://jend.leeeet.dev/definition.txt?path=bend-kit-redis@0.3.0.0/redis.bend&name=int.done) def int.done(m: Maybe<&1, Val>, +next: U32, stack: List<&1, Frame>) -> St: Redis.int.st (https://jend.leeeet.dev/definition.txt?path=bend-kit-redis@0.3.0.0/redis.bend&name=int.st) def int.st(+next: U32, stack: List<&1, Frame>, r: Bytes.Bytes & Num) -> Bytes.Bytes & St: Redis.boolean.done (https://jend.leeeet.dev/definition.txt?path=bend-kit-redis@0.3.0.0/redis.bend&name=boolean.done) def boolean.done(ok: Bool, +v: Bool, +next: U32, stack: List<&1, Frame>) -> St: Redis.boolean.st (https://jend.leeeet.dev/definition.txt?path=bend-kit-redis@0.3.0.0/redis.bend&name=boolean.st) def boolean.st(+next: U32, stack: List<&1, Frame>, +one: Bool, r: Bytes.Bytes & U32) -> Bytes.Bytes & St: Redis.blob.mk (https://jend.leeeet.dev/definition.txt?path=bend-kit-redis@0.3.0.0/redis.bend&name=blob.mk) def blob.mk(+kind: U32, d: Bytes.Bytes) -> Val: Redis.blob.done (https://jend.leeeet.dev/definition.txt?path=bend-kit-redis@0.3.0.0/redis.bend&name=blob.done) def blob.done(+kind: U32, +after: U32, stack: List<&1, Frame>, r: Bytes.Bytes & Bytes.Bytes) -> Bytes.Bytes & St: Redis.verb.text (https://jend.leeeet.dev/definition.txt?path=bend-kit-redis@0.3.0.0/redis.bend&name=verb.text) def verb.text(f: Bytes.Bytes, +after: U32, stack: List<&1, Frame>, r: Bytes.Bytes & Bytes.Bytes) -> Bytes.Bytes & St: Redis.verb.fmt (https://jend.leeeet.dev/definition.txt?path=bend-kit-redis@0.3.0.0/redis.bend&name=verb.fmt) def verb.fmt(+n: U32, +next: U32, stack: List<&1, Frame>, r: Bytes.Bytes & Bytes.Bytes) -> Bytes.Bytes & St: Redis.verb.ok (https://jend.leeeet.dev/definition.txt?path=bend-kit-redis@0.3.0.0/redis.bend&name=verb.ok) def verb.ok(ok: Bool, +n: U32, +next: U32, stack: List<&1, Frame>, b: Bytes.Bytes) -> Bytes.Bytes & St: Redis.verb.colon (https://jend.leeeet.dev/definition.txt?path=bend-kit-redis@0.3.0.0/redis.bend&name=verb.colon) def verb.colon(+n: U32, +next: U32, stack: List<&1, Frame>, r: Bytes.Bytes & U32) -> Bytes.Bytes & St: Redis.verb.len (https://jend.leeeet.dev/definition.txt?path=bend-kit-redis@0.3.0.0/redis.bend&name=verb.len) # A verbatim string is a 3-byte format, a colon, then the text. def verb.len(ok: Bool, +n: U32, +next: U32, stack: List<&1, Frame>, b: Bytes.Bytes) -> Bytes.Bytes & St: Redis.blob.val (https://jend.leeeet.dev/definition.txt?path=bend-kit-redis@0.3.0.0/redis.bend&name=blob.val) def blob.val(+kind: U32, +n: U32, +next: U32, stack: List<&1, Frame>, b: Bytes.Bytes) -> Bytes.Bytes & St: Redis.blob.crlf (https://jend.leeeet.dev/definition.txt?path=bend-kit-redis@0.3.0.0/redis.bend&name=blob.crlf) def blob.crlf(+kind: U32, +n: U32, +next: U32, stack: List<&1, Frame>, r: Bytes.Bytes & Bool) -> Bytes.Bytes & St: Redis.crlf.at (https://jend.leeeet.dev/definition.txt?path=bend-kit-redis@0.3.0.0/redis.bend&name=crlf.at) def crlf.at(b: Bytes.Bytes, +j: U32) -> Bytes.Bytes & Bool: Redis.blob.fit (https://jend.leeeet.dev/definition.txt?path=bend-kit-redis@0.3.0.0/redis.bend&name=blob.fit) def blob.fit(ok: Bool, +kind: U32, +n: U32, +next: U32, stack: List<&1, Frame>, b: Bytes.Bytes) -> Bytes.Bytes & St: Redis.blob.room (https://jend.leeeet.dev/definition.txt?path=bend-kit-redis@0.3.0.0/redis.bend&name=blob.room) def blob.room(+kind: U32, +n: U32, +next: U32, stack: List<&1, Frame>, r: Bytes.Bytes & U32) -> Bytes.Bytes & St: Redis.blob.bad (https://jend.leeeet.dev/definition.txt?path=bend-kit-redis@0.3.0.0/redis.bend&name=blob.bad) def blob.bad(bad: Bool, +kind: U32, +n: U32, +next: U32, stack: List<&1, Frame>, b: Bytes.Bytes) -> Bytes.Bytes & St: Redis.blob.nil (https://jend.leeeet.dev/definition.txt?path=bend-kit-redis@0.3.0.0/redis.bend&name=blob.nil) # $-1 is RESP2's null bulk string; ! and = have no null form. def blob.nil(nil: Bool, +kind: U32, +n: U32, +next: U32, stack: List<&1, Frame>, b: Bytes.Bytes) -> Bytes.Bytes & St: Redis.blob.st (https://jend.leeeet.dev/definition.txt?path=bend-kit-redis@0.3.0.0/redis.bend&name=blob.st) # kind 0 is $, 1 is !, 2 is =. def blob.st(+kind: U32, +next: U32, stack: List<&1, Frame>, r: Bytes.Bytes & Num) -> Bytes.Bytes & St: Redis.agg.open (https://jend.leeeet.dev/definition.txt?path=bend-kit-redis@0.3.0.0/redis.bend&name=agg.open) def agg.open(empty: Bool, +kind: U32, +left: U32, +next: U32, stack: List<&1, Frame>) -> St: Redis.agg.left (https://jend.leeeet.dev/definition.txt?path=bend-kit-redis@0.3.0.0/redis.bend&name=agg.left) # A map of n pairs has 2n items; an attribute adds the reply after its pairs. def agg.left(+kind: U32, +n: U32) -> U32: Redis.agg.bad (https://jend.leeeet.dev/definition.txt?path=bend-kit-redis@0.3.0.0/redis.bend&name=agg.bad) def agg.bad(bad: Bool, +kind: U32, +n: U32, +next: U32, stack: List<&1, Frame>) -> St: Redis.agg.nil (https://jend.leeeet.dev/definition.txt?path=bend-kit-redis@0.3.0.0/redis.bend&name=agg.nil) # *-1 is RESP2's null array. def agg.nil(nil: Bool, +kind: U32, +n: U32, +next: U32, stack: List<&1, Frame>) -> St: Redis.agg.st (https://jend.leeeet.dev/definition.txt?path=bend-kit-redis@0.3.0.0/redis.bend&name=agg.st) def agg.st(+kind: U32, +next: U32, stack: List<&1, Frame>, r: Bytes.Bytes & Num) -> Bytes.Bytes & St: Redis.item (https://jend.leeeet.dev/definition.txt?path=bend-kit-redis@0.3.0.0/redis.bend&name=item) # The type byte t, then the line from s until the CRLF at e. def item(+t: U32, +s: U32, +e: U32, b: Bytes.Bytes, stack: List<&1, Frame>) -> Bytes.Bytes & St: Redis.head.eol (https://jend.leeeet.dev/definition.txt?path=bend-kit-redis@0.3.0.0/redis.bend&name=head.eol) def head.eol(+t: U32, +i: U32, stack: List<&1, Frame>, r: Bytes.Bytes & Maybe<&2, U32>) -> Bytes.Bytes & St: Redis.head.end (https://jend.leeeet.dev/definition.txt?path=bend-kit-redis@0.3.0.0/redis.bend&name=head.end) def head.end(end: Bool) -> St: Redis.head.known (https://jend.leeeet.dev/definition.txt?path=bend-kit-redis@0.3.0.0/redis.bend&name=head.known) def head.known(ok: Bool, +t: U32, +i: U32, stack: List<&1, Frame>, b: Bytes.Bytes) -> Bytes.Bytes & St: Redis.head (https://jend.leeeet.dev/definition.txt?path=bend-kit-redis@0.3.0.0/redis.bend&name=head) def head(+i: U32, stack: List<&1, Frame>, r: Bytes.Bytes & U32) -> Bytes.Bytes & St: Redis.done.last (https://jend.leeeet.dev/definition.txt?path=bend-kit-redis@0.3.0.0/redis.bend&name=done.last) def done.last(last: Bool, +kind: U32, +left: U32, xs: List<&1, Val>, +i: U32, rest: List<&1, Frame>) -> St: Redis.done (https://jend.leeeet.dev/definition.txt?path=bend-kit-redis@0.3.0.0/redis.bend&name=done) def done(stack: List<&1, Frame>, v: Val, +i: U32) -> St: Redis.run (https://jend.leeeet.dev/definition.txt?path=bend-kit-redis@0.3.0.0/redis.bend&name=run) def run(fuel: Nat, r: Bytes.Bytes & St) -> Bytes.Bytes & Step: Redis.decode (https://jend.leeeet.dev/definition.txt?path=bend-kit-redis@0.3.0.0/redis.bend&name=decode) # One reply starting at byte i of b. Every item takes at least 3 bytes and each step # reads an item or closes one, so 2 * (len - i) + 2 steps are enough. def decode(b: Bytes.Bytes, +i: U32) -> Bytes.Bytes & Step: Redis.Reader (https://jend.leeeet.dev/definition.txt?path=bend-kit-redis@0.3.0.0/redis.bend&name=Reader) # Bytes read from the server, and the index of the first byte not yet decoded. type Reader is Type: Reader{buf: Bytes.Bytes, pos: U32} Redis.reader (https://jend.leeeet.dev/definition.txt?path=bend-kit-redis@0.3.0.0/redis.bend&name=reader) def reader() -> Reader: Redis.feed.at (https://jend.leeeet.dev/definition.txt?path=bend-kit-redis@0.3.0.0/redis.bend&name=feed.at) def feed.at(zero: Bool, buf: Bytes.Bytes, +pos: U32, chunk: Bytes.Bytes) -> Reader: Redis.feed (https://jend.leeeet.dev/definition.txt?path=bend-kit-redis@0.3.0.0/redis.bend&name=feed) # Drops the decoded bytes, then adds chunk. # ponytail: a reply split over k reads is decoded from its start k times; keep state per item if huge arrays arrive slowly. def feed(r: Reader, chunk: Bytes.Bytes) -> Reader: Redis.Next (https://jend.leeeet.dev/definition.txt?path=bend-kit-redis@0.3.0.0/redis.bend&name=Next) type Next is Type: Got{v: Val} Want{} Broken{} Redis.next.of (https://jend.leeeet.dev/definition.txt?path=bend-kit-redis@0.3.0.0/redis.bend&name=next.of) def next.of(+pos: U32, r: Bytes.Bytes & Step) -> Reader & Next: Redis.next (https://jend.leeeet.dev/definition.txt?path=bend-kit-redis@0.3.0.0/redis.bend&name=next) # The next whole reply, Want when it has not all arrived, or Broken for bytes that are not RESP. def next(r: Reader) -> Reader & Next: Redis.pending.of (https://jend.leeeet.dev/definition.txt?path=bend-kit-redis@0.3.0.0/redis.bend&name=pending.of) def pending.of(+pos: U32, r: Bytes.Bytes & U32) -> Reader & U32: Redis.pending (https://jend.leeeet.dev/definition.txt?path=bend-kit-redis@0.3.0.0/redis.bend&name=pending) # The count of bytes read but not yet decoded. def pending(r: Reader) -> Reader & U32: Redis.Config (https://jend.leeeet.dev/definition.txt?path=bend-kit-redis@0.3.0.0/redis.bend&name=Config) # host is a name or a numeric address; TLS checks the certificate against it. Empty user # and pass send no AUTH (a pass alone authenticates as "default"); db 0 sends no SELECT. # ms bounds each connect and read (0: none). type Config is Data: Config{host: String, port: U32, tls: Bool, user: String, pass: String, db: U32, ms: U32} Redis.config (https://jend.leeeet.dev/definition.txt?path=bend-kit-redis@0.3.0.0/redis.bend&name=config) def config(+host: String, +port: U32) -> Config: Redis.Failure (https://jend.leeeet.dev/definition.txt?path=bend-kit-redis@0.3.0.0/redis.bend&name=Failure) # A failed call closes its connection. Rejected carries the server's error reply to the handshake. type Failure is Type: IoFail{code: U32, why: String} Closed{} Malformed{} Rejected{reply: Val} Redis.Conn (https://jend.leeeet.dev/definition.txt?path=bend-kit-redis@0.3.0.0/redis.bend&name=Conn) # key names the pool bucket: TLS, user, host, port, and db. type Conn is Type: Conn{tls: Bool, sock: Socket, rd: Reader, key: String, ms: U32} Redis.io.close (https://jend.leeeet.dev/definition.txt?path=bend-kit-redis@0.3.0.0/redis.bend&name=io.close) def io.close(tls: Bool, s: Socket) -> IO(Unit): Redis.io.send (https://jend.leeeet.dev/definition.txt?path=bend-kit-redis@0.3.0.0/redis.bend&name=io.send) def io.send(tls: Bool, s: Socket, +len: U32, buf: Array) -> IO(Socket & Result<&1, &1, U32 & String, Unit>): More: https://jend.leeeet.dev/packages/bend-kit-redis.txt?definitions_offset=100