视频分析2.0 多进程拆分仓库
zhangmeng
2019-05-06 ffd71d97fc9eb5236e6a92db408745ddf080217b
analysis/work/service/ipcreciever.go
File was renamed from analysis/work/service/reciever.go
@@ -53,21 +53,24 @@
   }
}
// Run run task from ipc data
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)
   }
func (r *Reciever) run(i *ipc.IPC) {
   dataChan := make(chan []byte)
   go unserilizeImageInfo(dataChan, r.chImage)
   i.RecvToChannel(dataChan)
}
// RunAsServer run a IPC server
func (r *Reciever) RunAsServer() {
   r.run(ipc.NewServer(r.ctxIPC.ctx, r.ipcURL))
}
// RunAsClient run as a IPC client
func (r *Reciever) RunAsClient() {
   r.run(ipc.NewClient(r.ctxIPC.ctx, r.ipcURL))
}
// Stop stop reciever, run in goroutine
func (r *Reciever) Stop() {
   if r.ctxIPC.cancel != nil {