package com.yami.shop.seckill.api.mq.redis;

import lombok.AllArgsConstructor;
import org.redisson.Redisson;
import org.redisson.api.ExpiredObjectListener;
import org.redisson.api.RBlockingDeque;
import org.redisson.api.RDeque;
import org.springframework.stereotype.Component;

/**
 * @author LGH
 */
@Component
@AllArgsConstructor
public class RedissonMsgHandler {

    private final Redisson redisson;

    public <T> void sendChannelMess(String channel, T message) {
        RBlockingDeque<T> queue = redisson.getBlockingDeque(channel);
        queue.addLastAsync(message);
    }
}
