channels_redis icon indicating copy to clipboard operation
channels_redis copied to clipboard

Missing documentation on how to set `connection_kwargs` params.

Open slyapustin opened this issue 3 years ago • 3 comments

What is the right way to specify connection_kwargs?

Based on the changelog - it was implemented a while ago, but there are no examples on how to set that and no mentions in the docs.

I'm happy to submit PR, but I can't figure out how to set them on my own 🤔

1.3.0 (2017-04-07)

  • Change the format of connection arguments to be a single dict called connection_kwargs rather than individual options, as they change by connection type. You will need to change your settings if you have any of socket_connect_timeout, socket_timeout, socket_keepalive or socket_keepalive_options set to move them into a connection_kwargs dict.

slyapustin avatar Sep 28 '22 12:09 slyapustin

connection_kwargs will just be passed to the underlying library no?

carltongibson avatar Sep 28 '22 12:09 carltongibson

@carltongibson How it should look in the CHANNEL_LAYERS configuration?

CHANNEL_LAYERS = {
    "default": {
        "BACKEND": "channels_redis.core.RedisChannelLayer",
        # how to pass `socket_connect_timeout`, `socket_timeout` and etc?
    }
}

slyapustin avatar Sep 28 '22 14:09 slyapustin

This might be relevant to #331

slyapustin avatar Oct 06 '22 17:10 slyapustin

This should be resolved by https://github.com/django/channels_redis/pull/370.

carltongibson avatar Sep 04 '23 11:09 carltongibson