GithubHelp home page GithubHelp logo

Comments (1)

bbrowning918 avatar bbrowning918 commented on August 16, 2024 1

The hosts section of the README outlines some very basic examples and has a link to the redis connection docs with all the config redis-py supports. Some different wording or another example might help make that more visible or clear.

The main channels docs is sparse on the config topic but the root of it is channels-redis just passes things along as-is.

As for matching up with the cache framework exactly, I can already see some mismatch between redis-py expecting connection_pool and the cache framework using CONNECTION_POOL_CLASS which might be hard to enforce/standardize. Would sharing some variables work?

REDIS = "redis://127.0.0.1:6379"
POOL = "redis.connection.ConnectionPool"
TIMEOUT = 3600

CACHES = {
    "default": {
        "BACKEND": "django.core.cache.backends.redis.RedisCache",
        "LOCATION": REDIS,
        "OPTIONS": {
           "CONNECTION_POOL_CLASS": POOL,
           "SOCKET_CONNECT_TIMEOUT": TIMEOUT
       }
    }
}

CHANNEL_LAYERS = {
    "default: {
        "CONFIG": {
           "hosts" = [{
               "address": REDIS,
               "connection_pool": POOL,
               "socket_connect_timeout": TIMEOUT
           }]
       }
    }
}

Forgive any config errors, I am guessing on the formats/syntax :D

from channels_redis.

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.