graphql-redis-subscriptions
graphql-redis-subscriptions copied to clipboard
Add a way to check status of connection to redis
export default async () => {
const redisConnection = new RedisPubSub({
connection: {
host: redis.host,
port: redis.port,
retry_strategy: options => Math.max(options.attempt * 100, 3000),
}
});
console.log('redisConnection', redisConnection)
return redisConnection;
}
I was curious about this. It appears you can observe the status of the underlying connection to either subscriber (and presumably the publisher) with:
redisConnection.redisSubscriber.status
(using your above example). This flag will transition from connecting
to connected
when the connection is established. HTH
Hey @Yasir5247 @DrPep, I'd happy to merge any PR that exposes the connection state for simpler usage.