func (c *ParCollector) send(sg *goiso.SubGraph) { label := sg.ShortLabel() lg := &labelGraph{label, sg} bkt := hash(label) % len(c.chs) next := bkt for i := 0; i < len(c.chs); i++ { select { case c.chs[next] <- lg: return default: next = (next + 1) % len(c.chs) } } c.chs[bkt] <- lg }
func (c *SerialCollector) send(sg *goiso.SubGraph) { c.ch <- &labelGraph{sg.ShortLabel(), sg} }
func (c *ParHashCollector) send(sg *goiso.SubGraph) { label := sg.ShortLabel() idx := hash(label) % len(c.chs) c.chs[idx] <- &labelGraph{label, sg} }