最近有人写了一个 Common Lisp 的 memcached 客户端软件包:
http://common-lisp.net/project/cl-memcached/
不过作者是在 Allegro CL 8.0 上面开发的。我做了一些小小的改动,于是可以在 LispWorks 5.0.2 上正常运行了:
CL-USER 3 > (defvar *my-cache*
(cl-memcached:mc-make-memcache-instance
:ip "127.0.0.1"
:name "My test cache"))
#<CL-MEMCACHED:MEMCACHE My test cache on 127.0.0.1:11211 SIZE:-1/1048576Mb>
CL-USER 4 > (cl-memcached:mc-store "test-key"
"This is Test-DATA"
:memcache *my-cache* :use-pool t)
"STORED"
CL-USER 5 > (cl-memcached:mc-get '("test-key")
:memcache *my-cache* :use-pool t)
(("test-key"
#(84 104 105 115 32 105 115 32 84 101 115 116 45 68 65 84 65)))
CL-USER 6 > (cl-memcached:mc-get+ "test-key"
:memcache *my-cache* :use-pool t)
"This is Test-DATA"
CL-USER 7 > (cl-memcached:mc-get '("test-key")
:memcache *my-cache* :use-pool t :is-string t)
(("test-key" "This is Test-DATA"))
CL-USER 8 > (cl-memcached:mc-store "test-key-2"
"This is Test-DATA Again"
:memcache *my-cache* :use-pool t)
"STORED"
CL-USER 9 > (cl-memcached:mc-get '("test-key" "test-key-2")
:memcache *my-cache* :use-pool t :is-string t)
(("test-key" "This is Test-DATA")
("test-key-2" "This is Test-DATA Again"))
一个交互式的 MemCache 客户端,应该还是有些用处的。
评论