视频分析2.0 多进程拆分仓库
zhangmeng
2019-04-30 d3618c4e9ceab273a52813c1f2c462912fb81e59
decoder/work/service/reciever.go
@@ -54,13 +54,18 @@
}
// Run run task from ipc data
func (r *Reciever) Run() {
   ipc := ipc.NewClient(r.ctxIPC.ctx, r.ipcURL)
func (r *Reciever) Run(asServer bool) {
   var i *ipc.IPC
   if asServer {
      i = ipc.NewServer(r.ctxIPC.ctx, r.ipcURL)
   } else {
      i = ipc.NewClient(r.ctxIPC.ctx, r.ipcURL)
   }
   dataChan := make(chan []byte)
   go unserilizeImageInfo(dataChan, r.chImage)
   ipc.RecvToChannel(dataChan)
   i.RecvToChannel(dataChan)
}
// Stop stop reciever, run in goroutine