Esempio n. 1
0
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
}
Esempio n. 2
0
func (c *SerialCollector) send(sg *goiso.SubGraph) {
	c.ch <- &labelGraph{sg.ShortLabel(), sg}
}
Esempio n. 3
0
func (c *ParHashCollector) send(sg *goiso.SubGraph) {
	label := sg.ShortLabel()
	idx := hash(label) % len(c.chs)
	c.chs[idx] <- &labelGraph{label, sg}
}