lack-session-store-redis-pool
May 25, 2024 ยท View on GitHub
This project is a fork of lack-session-store-redis that adds connection pooling using anypool.
Usage
Wrap app:
(funcall lack/middleware/session:*lack-middleware-session*
*app*
:store (lack/middleware/session/store/redis-pool:make-redis-store
:host "redis01.acme.example.com"
:max-open-count 10
:max-idle-count 3))
Lack Builder:
(lack/builder
(:session :store (lack/middleware/session/store/redis-pool:make-redis-store
:host "redis01.acme.example.com"
:max-open-count 10
:max-idle-count 3))
*app*)
Store options
HOST: optional; the hostname of the Redis server to connect to (default: "127.0.0.1")PORT: optional; the port number of the Redis server to connect to (default: 6379)AUTH: optional; the Redis authentication password (default: NIL)NAMESPACE: optional; the key prefix under which to write all session data (default: "session")EXPIRES: optional; TTL for session data, in seconds (default: NIL)SERIALIZER: optional; function for serializing Lisp data to Redis (default uses cl-marshal)DESERIALIZER: optional; function for deserializing data from Redis back to Lisp (default uses cl-marshal)POOL: optional; provide anANYPOOL:POOLinstance directly and skip other pool-related options (default: NIL)POOL-NAME: optional; the name of theANYPOOL:POOLinstance (default: "lack-session-store-redis")MAX-OPEN-COUNT: optional; passed through toANYPOOL:MAKE-POOLkeyword arguments (default: 8)MAX-IDLE-COUNT: optional; passed through toANYPOOL:MAKE-POOLkeyword arguments (default: 4)TIMEOUT: optional; passed through toANYPOOL:MAKE-POOLkeyword arguments (default: 2000)IDLE-TIMEOUT: optional; passed through toANYPOOL:MAKE-POOLkeyword arguments (default: 60000)ON-TOO-MANY-OPEN-CONNECTIONS: optional; function called fromHANDLER-BINDhandler forANYPOOL:TOO-MANY-OPEN-CONNECTIONerror before re-signalling asREDIS-POOL-TIMEOUT-ERROR; may be useful for publishing a metric or some other purpose
Installation
Not in Quicklisp, so clone the repository to "local-projects/".
Development
Run tests:
(asdf:test-system :foo.lisp.lack-session-store-redis-pool)
Dependencies
Tests
Author
- John Newton (jnewton@lisplizards.dev)
Copyright
- Eitaro Fukamachi (author of Lack, lack-session-store-redis)
- John Newton (adapter & maintainer)
Original source, by Eitaro Fukamachi: lack/request
Adaptations by John Newton:
- extract to separate git repository
- add connection pooling
License
MIT