All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.zlyx.easy.asyn.interfaces.AsynMsgCustomer Maven / Gradle / Ivy

There is a newer version: 4.3.11
Show newest version
package com.zlyx.easy.asyn.interfaces;

import java.lang.reflect.ParameterizedType;

/**
 * @Auth 赵光
 * @Describle 异步消息消费者接口
 * @2019年9月7日
 */
public interface AsynMsgCustomer {

	/**
	 * 消息订阅
	 * 
	 * @param channel 通道
	 * @param msgBody 消息内容
	 */
	public void subscribe(String channel, T msg);

	/*
	 * 读取抽象类
	 * 
	 * @return
	 */
	@SuppressWarnings("unchecked")
	default Class getTClass() {
		return (Class) ((ParameterizedType) this.getClass().getGenericInterfaces()[0]).getActualTypeArguments()[0];
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy