top.jfunc.common.thread.conpro.Producer Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of utils Show documentation
Show all versions of utils Show documentation
common utils like IOUtil,StrUtil,HoldProcessor.etc.
package top.jfunc.common.thread.conpro;
import java.util.concurrent.BlockingQueue;
/**
* @author xiongshiyan
* 通用的消费者
*/
public class Producer {
public static void offer(BlockingQueue blockingQueue , T t){
blockingQueue.offer(t);
}
public static void offer(String pipelineName , T t){
BlockingQueue blockingQueue = QueueHolder.getBlockingQueue(pipelineName);
blockingQueue.offer(t);
}
}