public async Task <long> PublishAsync(RedisValue metadata, RedisValue[] values)
        {
            if (_subscriber == null)
            {
                Open();
            }

            var listKeyBase = $"{_pubSubChannel}.{Guid.NewGuid():N}";
            var x           = Google.Protobuf.ByteString.CopyFromUtf8(listKeyBase);
            var msg         = new PubSubMessage
            {
                ListKey  = ByteString.CopyFromUtf8(listKeyBase),
                Metadata = ByteString.CopyFrom(metadata)
            };

            long count = 0;

            foreach (var pair in _db.HashScan(_pubSubGroupsHash))
            {
                int subscribers;
                if (pair.Value.TryParse(out subscribers) && subscribers > 0)
                {
                    var listKey = $"{listKeyBase}:{pair.Name}";
                    count = await _db.ListRightPushAsync(listKey, values);
                }
            }

            await _subscriber.PublishAsync(_pubSubChannel, msg.ToByteArray());

            return(count);
        }
        private async void ProcessQueue(PubSubMessage message)
        {
            var listKey  = ((RedisKey)message.ListKey.ToByteArray()).Append(_groupSuffix);
            var metadata = message.Metadata.ToByteArray();
            var actions  = _subscriptions.ToArray();

            try
            {
                RedisValue value;
                while ((value = await _db.ListLeftPopAsync(listKey)).HasValue)
                {
                    for (int i = 0; i < actions.Length; i++)
                    {
                        FireAndForget(actions[i], metadata, value);
                    }
                    await Task.Delay(1);
                }
            }
            finally
            {
                bool _;
                _running.TryRemove(message.ListKey.ToStringUtf8(), out _);
            }
        }