Code Monkey home page Code Monkey logo

Comments (6)

oscartbeaumont avatar oscartbeaumont commented on July 19, 2024 1

@aembke is there a way to convert a Redis connection URL into a RedisConfig struct? This would be very useful when loading the Redis configuration from environment variables without having to define a heap of different variables.

from fred.rs.

aembke avatar aembke commented on July 19, 2024 1

Closing this for the time being, but feel free to re-open if you have any more questions.

@oscartbeaumont the URL parsing changes are in the main branch now, which I'm planning on releasing shortly as 5.0.0.

from fred.rs.

aembke avatar aembke commented on July 19, 2024

Hi @juanki03,

There's a few ways to do this, but I would recommend checking out the basic starter examples to see the full config options.

However, you don't need to use every field there. You can also do something like this:

  let config = RedisConfig {
    server: ServerConfig::new_centralized("127.0.0.1", 6379),
    .. Default::default
    },
  };
  let client = RedisClient::new(config);

from fred.rs.

juanki03 avatar juanki03 commented on July 19, 2024

Thank you! Another question @aembke :

How can I change the name of the client, which comes by default "fred-" ?

from fred.rs.

aembke avatar aembke commented on July 19, 2024

@juanki03 you can use the client_setname function to do that.

@oscartbeaumont there isn't at the moment, but that's a great idea. I'm going to add that to the PR for 5.0.0 so it'll be available shortly.

from fred.rs.

oscartbeaumont avatar oscartbeaumont commented on July 19, 2024

Thanks!

from fred.rs.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.