Store Configuration#
1) RedisStore#
RedisStore is developed based on the Redis API provided by redis-py.
In terms of Redis connection configuration management, the configuration naming of django-redis is basically used to reduce the learning cost.
from throttled import store
store.RedisStore(server="redis://127.0.0.1:6379/0", options={"PASSWORD": ""})
from throttled.asyncio import store
store.RedisStore(server="redis://127.0.0.1:6379/0", options={"PASSWORD": ""})
Arguments#
|
|
|
|
<Options> |
|
Options#
Parameter |
Description |
Default |
|---|---|---|
|
ConnectionFactory is used to create and maintain ConnectionPool. |
|
|
ConnectionPool import path. |
|
|
|
|
|
RedisClient import path, uses redis.client.Redis by default. |
|
|
|
|
|
Password. |
|
|
ConnectionPool parameters. |
|
|
ConnectionPool parameters. |
|
|
|
|
|
|
2) MemoryStore#
MemoryStore is essentially a memory-based
LRU Cache with expiration time.
from throttled import store
store.MemoryStore(options={"MAX_SIZE": 10240})
from throttled.asyncio import store
store.MemoryStore(options={"MAX_SIZE": 10240})
Arguments#
|
<Options> |
|
Options#
Parameter |
Description |
Default |
|---|---|---|
|
Maximum capacity. When the number of stored key-value pairs exceeds |
|