RedisOptions class
Constructors
RedisOptions ({String keyPrefix = '' , String host = '127.0.0.1' , int port = 6379 , bool secure = false , Duration connectTimeout = const Duration(seconds: 10) , String ? username , String ? password , int db = 0 , Duration retryStrategy (int )?, void onError (dynamic )?, int maxConnection = 10 , Duration idleTimeout = const Duration(seconds: 10) , bool onBadCertificate (X509Certificate )?, Duration ? commandTimeout = defaultCommandTimeout , int ? maxQueuedCommands })
RedisOptions.fromUrl (String url , {String keyPrefix = '' , Duration connectTimeout = const Duration(seconds: 10) , Duration retryStrategy (int )?, void onError (dynamic )?, int maxConnection = 10 , Duration idleTimeout = const Duration(seconds: 10) , bool onBadCertificate (X509Certificate )?, Duration ? commandTimeout = defaultCommandTimeout , int ? maxQueuedCommands })
Make options from a redis:// or rediss:// URL.
factory
Properties
commandTimeout
→ Duration ?
Most time a command waits for its reply, counted from the call.
It covers the wait for a connect too. After it, the command fails
with RedisTimeoutError . Default 10 seconds.
null or Duration.zero turns it off (wait forever).
final
connectTimeout
→ Duration
timeout for the socket connect, and again for the handshake
(AUTH, SELECT and SUBSCRIBE again after a reconnect)
final
db
↔ int
database index defaults to 0
getter/setter pair
hashCode
→ int
The hash code for this object.
no setter inherited
host
↔ String
redis host
getter/setter pair
idleTimeout
↔ Duration
timeout duration of idle connection in the pool, default to 10s
getter/setter pair
keyPrefix
↔ String
key prefix
getter/setter pair
maxConnection
↔ int
maximum connection pool, default to 10;
getter/setter pair
maxQueuedCommands
→ int ?
Most commands that may wait for a connect at one time, per connection.
One more command fails at once with RedisQueueFullError .
Default null: no limit. Set it to turn the limit on.
final
onBadCertificate
↔ bool Function(X509Certificate ) ?
An optional callback for handling server SSL certificate validation.
getter/setter pair
onError
↔ void Function(dynamic ) ?
error handler
getter/setter pair
password
→ String ?
redis password
final
port
↔ int
redis port
getter/setter pair
retryStrategy
→ Duration Function(int ) ?
retry strategy defaults to
min(50 * times, 2000)
final
runtimeType
→ Type
A representation of the runtime type of the object.
no setter inherited
secure
→ bool
use secure socket
final
username
→ String ?
redis username
final
Methods
noSuchMethod (Invocation invocation )
→ dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString ()
→ String
A string representation of this object.
inherited