0.6
This commit is contained in:
parent
981144c743
commit
5ed8812f67
6 changed files with 138 additions and 128 deletions
|
@ -1,2 +1,3 @@
|
|||
((scheme-mode . ((flymake-chicken-command-args . ("-X" "r7rs" "-R" "r7rs"))
|
||||
(geiser-scheme . 'chicken))))
|
||||
((org-mode . ((geiser-scheme-implementation . chicken)))
|
||||
(scheme-mode . ((flymake-chicken-command-args . ("-X" "r7rs" "-R" "r7rs"))
|
||||
(geiser-scheme-implementation . chicken))))
|
||||
|
|
1
.envrc
Normal file
1
.envrc
Normal file
|
@ -0,0 +1 @@
|
|||
use guix chicken chicken-test chicken-r7rs chicken-srfi-34 chicken-srfi-35 chicken-srfi-69 chicken-srfi-99 chicken-srfi-113 chicken-srfi-128 chicken-srfi-133 chicken-srfi-152 chicken-srfi-158 redis
|
|
@ -2,6 +2,7 @@
|
|||
(import r7rs
|
||||
(chicken base)
|
||||
(chicken port)
|
||||
(chicken string)
|
||||
(chicken io)
|
||||
(chicken tcp)
|
||||
(srfi 34) ;; Exception Handling
|
||||
|
@ -28,15 +29,17 @@
|
|||
;; Connection Management
|
||||
;; This egg currently uses a simple TCP connection without any "bells and whistles". The two ports are kept in a record of type =redis-connection= in the fields ~input~ and ~output~.
|
||||
|
||||
;; ~(redis-connect host port)~
|
||||
;; Connects to a (hopefully) Redis server at =host:port=.
|
||||
;; ~(redis-connect host port #!optional (protocol-version 1))~
|
||||
;; Connects to a (hopefully) Redis server at =host:port=, using the given protocol version. Defaults, like Redis itself, to version 1.
|
||||
|
||||
|
||||
;; [[file:redis.org::*Connection Management][Connection Management:1]]
|
||||
(define-record-type redis-connection #t #t input output)
|
||||
(define (redis-connect host port)
|
||||
(define (redis-connect host port #!optional (protocol-version 1))
|
||||
(let-values (((i o) (tcp-connect host port)))
|
||||
(make-redis-connection i o)))
|
||||
(values (make-redis-connection i o)
|
||||
(and (write-line (string-append "HELLO " (->string protocol-version)) o)
|
||||
(redis-read-reply i)))))
|
||||
;; Connection Management:1 ends here
|
||||
|
||||
|
||||
|
@ -80,7 +83,7 @@
|
|||
|
||||
;; Supported Data Types
|
||||
|
||||
;; This Redis client supports all data types up to and including as specified in [[https://github.com/antirez/RESP3/blob/master/spec.md][RESP3]]. Setting the protocol version with the =HELLO= command, however, is the user's responsibility.
|
||||
;; This Redis client supports all data types up to and including as specified in [[https://github.com/antirez/RESP3/blob/master/spec.md][RESP3]].
|
||||
|
||||
;; #+name: redis-read-reply
|
||||
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
(synopsis "A Redis client library for Chicken Scheme")
|
||||
(category db)
|
||||
(license "BSD")
|
||||
(version "0.5")
|
||||
(version "0.6")
|
||||
(dependencies r7rs srfi-34 srfi-35 srfi-69 srfi-99 srfi-113 srfi-128 srfi-133 srfi-152 srfi-158)
|
||||
(test-dependencies test)
|
||||
|
||||
|
|
14
redis.org
14
redis.org
|
@ -82,6 +82,7 @@
|
|||
(import r7rs
|
||||
(chicken base)
|
||||
(chicken port)
|
||||
(chicken string)
|
||||
(chicken io)
|
||||
(chicken tcp)
|
||||
(srfi 34) ;; Exception Handling
|
||||
|
@ -111,14 +112,16 @@ This library defines an SRFI-35 exception type ~&redis-error~ that gets raised w
|
|||
** Connection Management
|
||||
This egg currently uses a simple TCP connection without any "bells and whistles". The two ports are kept in a record of type =redis-connection= in the fields ~input~ and ~output~.
|
||||
|
||||
~(redis-connect host port)~
|
||||
Connects to a (hopefully) Redis server at =host:port=.
|
||||
~(redis-connect host port #!optional (protocol-version 1))~
|
||||
Connects to a (hopefully) Redis server at =host:port=, using the given protocol version. Defaults, like Redis itself, to version 1.
|
||||
|
||||
#+begin_src scheme :tangle redis-impl.scm :exports none
|
||||
(define-record-type redis-connection #t #t input output)
|
||||
(define (redis-connect host port)
|
||||
(define (redis-connect host port #!optional (protocol-version 1))
|
||||
(let-values (((i o) (tcp-connect host port)))
|
||||
(make-redis-connection i o)))
|
||||
(values (make-redis-connection i o)
|
||||
(and (write-line (string-append "HELLO " (->string protocol-version)) o)
|
||||
(redis-read-reply i)))))
|
||||
#+end_src
|
||||
|
||||
~(redis-disconnect rconn)~
|
||||
|
@ -156,7 +159,7 @@ Calls =proc= with the output port of the =rconn= as current output port, optiona
|
|||
|
||||
** Supported Data Types
|
||||
|
||||
This Redis client supports all data types up to and including as specified in [[https://github.com/antirez/RESP3/blob/master/spec.md][RESP3]]. Setting the protocol version with the =HELLO= command, however, is the user's responsibility.
|
||||
This Redis client supports all data types up to and including as specified in [[https://github.com/antirez/RESP3/blob/master/spec.md][RESP3]].
|
||||
|
||||
#+name: redis-read-reply
|
||||
#+begin_src scheme :tangle redis-impl.scm :exports none
|
||||
|
@ -567,6 +570,7 @@ Daniel Ziltener
|
|||
** Version History
|
||||
|
||||
#+name: version-history
|
||||
| 0.6 | Easier Protocol Version Setting |
|
||||
| 0.5 | Initial Release |
|
||||
|
||||
#+name: gen-releases
|
||||
|
|
|
@ -2,5 +2,6 @@
|
|||
;; -*- Scheme -*-
|
||||
(repo git "https://gitea.lyrion.ch/Chicken/redis.git")
|
||||
(uri targz "https://gitea.lyrion.ch/Chicken/redis/archive/{egg-release}.tar.gz")
|
||||
(release "0.6") ;; Easier Protocol Version Setting
|
||||
(release "0.5") ;; Initial Release
|
||||
;; Version History:3 ends here
|
||||
|
|
Loading…
Reference in a new issue