launchflow.gcp.memorystore

MemorystoreRedis

1
class MemorystoreRedis(Resource[MemorystoreRedisConnectionInfo])

A Redis resource running on Google Cloud's Memorystore service.

Attributes:

  • name (str): The name of the Redis VM resource. This must be globally unique.
  • memory_size_gb (int): The memory size of the Redis instance in GB. Defaults to 1.

Example usage:

1
import launchflow as lf
2
3
redis = lf.gcp.MemorystoreRedis("my-redis-instance")
4
5
# Set a key-value pair
6
client = redis.redis()
7
client.set("my-key", "my-value")
8
9
# Async compatible
10
async_client = await redis.redis_async()
11
await async_client.set("my-key", "my-value")

redis

1
def redis()

Get a Generic Redis Client object from the redis-py library.

Returns:

redis_async

1
async def redis_async()

Get an Async Redis Client object from the redis-py library.

Returns: