@@ -524,7 +524,7 @@ For production applications, consider these external engines:
524524
525525| Engine | Use Case | shard.yml |
526526| --------| ----------| -------|
527- | ** [ Redis] ( https://github.com/neovintage /kemal-session-redis ) ** | High performance, multiple servers | ` neovintage /kemal-session-redis` |
527+ | ** [ Redis] ( https://github.com/crystal-garage /kemal-session-redis-engine ) ** | High performance, multiple servers | ` crystal-garage /kemal-session-redis-engine ` |
528528| ** [ PostgreSQL] ( https://github.com/mang/kemal-session-postgres ) ** | Existing PostgreSQL infrastructure | ` mang/kemal-session-postgres ` |
529529| ** [ MySQL] ( https://github.com/crisward/kemal-session-mysql ) ** | Existing MySQL infrastructure | ` crisward/kemal-session-mysql ` |
530530| ** [ RethinkDB] ( https://github.com/kingsleyh/kemal-session-rethinkdb ) ** | Real-time applications | ` kingsleyh/kemal-session-rethinkdb ` |
@@ -536,21 +536,34 @@ For production applications, consider these external engines:
536536dependencies :
537537 kemal-session :
538538 github : kemalcr/kemal-session
539- kemal-session-redis :
540- github : neovintage /kemal-session-redis
539+ kemal-session-redis-engine :
540+ github : crystal-garage /kemal-session-redis-engin
541541` ` `
542542
543543` ` ` crystal
544544require "kemal"
545545require "kemal-session"
546- require "kemal-session-redis"
546+ require "kemal-session-redis-engine "
547547
548- Kemal::Session.config.engine = Kemal::Session::RedisEngine.new(
549- host : " localhost" ,
550- port : 6379,
551- password : ENV["REDIS_PASSWORD"]?,
552- database : 0
553- )
548+ Kemal::Session.config do |config|
549+ config.cookie_name = "redis_test"
550+ config.secret = "a_secret"
551+ config.engine = Kemal::Session::RedisEngine.new(
552+ " redis://localhost:6379/0?initial_pool_size=1&max_pool_size=10&checkout_timeout=10&retry_attempts=2&retry_delay=0.5&max_idle_pool_size=50" ,
553+ key_prefix : " my_app:session:"
554+ )
555+ config.timeout = Time::Span.new(1, 0, 0)
556+ end
557+
558+ get "/" do
559+ puts "Hello World"
560+ end
561+
562+ post "/sign_in" do |context|
563+ context.session.int("see-it-works", 1)
564+ end
565+
566+ Kemal.run
554567```
555568
556569### Custom Engine
0 commit comments