github.com/wangkui503/aero@v1.0.0/EventStream.go (about)

     1  package aero
     2  
     3  // EventStream includes a channel of events that we can send to
     4  // and a closed channel that we can check for closed connections.
     5  type EventStream struct {
     6  	Events chan *Event
     7  	Closed chan struct{}
     8  }
     9  
    10  // NewEventStream creates a new event stream.
    11  func NewEventStream() *EventStream {
    12  	return &EventStream{
    13  		Events: make(chan *Event),
    14  		Closed: make(chan struct{}),
    15  	}
    16  }