### Run Valkyrie Gleam Example with Docker Compose Source: https://github.com/pevensie/valkyrie/blob/main/README.md Commands to start a Redis-compatible database using Docker Compose for the example application and then execute the Valkyrie example application written in Gleam. ```bash docker compose --profile valkey up -d # You can also use profiles 'redis', 'keydb' or 'dragonfly' gleam run -m valkyrie/example ``` -------------------------------- ### Set Up Valkyrie Development Environment and Run Tests Source: https://github.com/pevensie/valkyrie/blob/main/README.md Instructions to start a local Redis-compatible database for development and testing using Docker Compose, and how to run all tests sequentially against different profiles using the Mise package manager. ```bash docker compose --profile valkey up -d # You can also use profiles 'redis', 'keydb' or 'dragonfly' ``` ```bash mise run test ``` -------------------------------- ### Install Valkyrie Gleam Client Source: https://github.com/pevensie/valkyrie/blob/main/README.md Instructions to add the Valkyrie package to a Gleam project using the gleam package manager. ```sh gleam add valkyrie ``` -------------------------------- ### Initialize and Use Valkyrie Connection Pool in Gleam Source: https://github.com/pevensie/valkyrie/blob/main/README.md Demonstrates how to set up a Valkyrie connection pool as part of an application's supervision tree using Gleam's static supervisor. It shows how to obtain a named connection from the pool and perform basic Redis-compatible operations like setting and getting keys. ```gleam import gleam/erlang/process import gleam/option import gleam/otp/static_supervisor as supervisor import valkyrie pub fn main() { // Create a name to interact with the connection pool once it's started under the // static supervisor. let pool_name = process.new_name("connection_pool") // Define a pool of 10 connections to the default Redis instance on localhost. let valkyrie_child_spec = valkyrie.default_config() |> valkyrie.supervised_pool( size: 10, name: option.Some(pool_name), timeout: 1000, ) // Start the pool under a supervisor let assert Ok(_started) = supervisor.new(supervisor.OneForOne) |> supervisor.add(valkyrie_child_spec) |> supervisor.start // Get the connection now that the pool is started let conn = valkyrie.named_connection(pool_name) // Use the connection. let assert Ok(_) = echo valkyrie.set(conn, "key", "value", option.None, 1000) let assert Ok(_) = echo valkyrie.get(conn, "key", 1000) // Do more stuff... } ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.