vibe.d beta banner
get vibe.d
0.10.1

Asynchronous I/O that doesn’t get in your way, written in D

Function connectRedisDB

Returns a Redis database connection instance corresponding to the given URL.

RedisDatabase connectRedisDB (
  URL url
) @safe;

The URL must be of the format "redis://server[:port]/dbnum".

Authentication

Authenticated connections are supported by using a URL connection string such as "redis://password@host".

Examples

// connecting with default settings:
auto redisDB = connectRedisDB("redis://127.0.0.1");
// connecting using the URL form with custom settings
auto redisDB = connectRedisDB("redis://password:myremotehost/3?maxmemory=10000000");

Parameters

NameDescription
url Redis URI scheme for a Redis database instance

Returns

A new RedisDatabase instance that can be used to access the database.

See also

Redis URI scheme

Authors

Jan Krüger, Sönke Ludwig, Michael Eisendle, Etienne Cimon

Copyright

© 2012-2016 Sönke Ludwig

License

Subject to the terms of the MIT license, as written in the included LICENSE.txt file.