github.com/artisanhe/tools@v1.0.1-0.20210607022958-19a8fef2eb04/catgo/cat-go/message/heartbeat.go (about)

     1  package message
     2  
     3  type Heartbeat struct {
     4  	Message
     5  }
     6  
     7  func (e *Heartbeat) Complete() {
     8  	if e.Message.flush != nil {
     9  		e.Message.flush(e)
    10  	}
    11  }
    12  
    13  func NewHeartbeat(mtype, name string, flush Flush) *Heartbeat {
    14  	return &Heartbeat{
    15  		Message: NewMessage(mtype, name, flush),
    16  	}
    17  }