package com.sjyt.icom.asst.context.publisher;

import com.sjyt.icom.asst.common.event.SrsCallBackEvent;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.context.ApplicationEventPublisher;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Component;

/**
 * <p>SrsCallBack事件发布器</p>
 * @author renyanru
 * @version V1.0.0
 * @date 2022/6/23 9:03
 */
@Slf4j
@Component
@AllArgsConstructor
public class SrsCallBackEventPublisher implements EventPublish<SrsCallBackEvent> {
    private final ApplicationEventPublisher applicationEventPublisher;

    /**
     * SrsCallBack回调事件
     * @param event evt
     */
    @Override
//    @Async("publisherAsync")
    public void publish(SrsCallBackEvent event) {
        log.info("SrsCallBack回调事件，事件类型：{}",event.getEventType());
        applicationEventPublisher.publishEvent(event);
    }
}
