package com.ruoyi.common.sse;

import lombok.Getter;

/**
 * 带类型的SseEmitter
 * @param <T>
 */
public class SseEmitter<T> extends org.springframework.web.servlet.mvc.method.annotation.SseEmitter {
  /**
   * 消息类型
   */
  @Getter
  private T type;

  public SseEmitter(long timeout, T type) {
    super(timeout);
    this.type = type;
  }

  public SseEmitter(T id) {
    this(Long.MAX_VALUE, id);
  }

  public SseEmitter() {
    this(Long.MAX_VALUE, null);
  }
}
