- (redis-connect [hostname] [port])procedure
Connect to a Redis server.
Parameters:
- hostname: Redis server hostname or IP address (string, optional, defaults to "localhost")
- port: Redis server port number (integer, optional, defaults to 6379)
Returns: Redis connection context pointer that can be used to set the redis-context parameter.
(redis-connect "127.0.0.1" 6379) (redis-connect "localhost" 6379) (redis-connect) ; Uses defaults: localhost:6379 (redis-connect "redis.example.com") ; Uses default port 6379
After connecting you will need to set the context for all the redis functions. This ensures that your local thread has a context available.
(redis-context (redis-connect ...))