remove result channel
This commit is contained in:
parent
6cc0ec1ee0
commit
2d5cff9c0f
|
@ -20,12 +20,25 @@ func (c *communicator) addEvent(e *events.Event) {
|
|||
c.Queue <- e
|
||||
}
|
||||
|
||||
//
|
||||
//func CompressDataGzip(data []byte) []byte {
|
||||
// var b bytes.Buffer
|
||||
// w := gzip.NewWriter(&b)
|
||||
// w.Write(data)
|
||||
// w.Close()
|
||||
// return b.Bytes()
|
||||
//}
|
||||
|
||||
func (c *communicator) start() {
|
||||
go func() {
|
||||
for e := range c.Queue {
|
||||
go func(event *events.Event) {
|
||||
m := event.Data.(events.URLMaker)
|
||||
data, _ := json.Marshal(event)
|
||||
|
||||
// compress , accept-encoding : gzip
|
||||
|
||||
//res, err := http.Post(GetRootURL()+m.GetUrl(), "application/json", bytes.NewBuffer(CompressDataGzip(data)))
|
||||
res, err := http.Post(GetRootURL()+m.GetUrl(), "application/json", bytes.NewBuffer(data))
|
||||
|
||||
// todo timeout,error
|
||||
|
|
|
@ -17,6 +17,7 @@ func (i PortStartEvent) GetUrl() string {
|
|||
func NewPortStartEvent(zone int64, host int64, portCount uint16, t string) *PortStartEvent {
|
||||
return &PortStartEvent{
|
||||
Zone: zone,
|
||||
Host: host,
|
||||
PortCount: portCount,
|
||||
Type: t,
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user