Commit 63e2295d authored by Jeromy's avatar Jeromy

msgio pooling first hack

parent 65feb72f
......@@ -241,3 +241,21 @@ func (n *dagService) Remove(nd *Node) error {
}
return n.Blocks.DeleteBlock(k)
}
func FetchGraph(ctx context.Context, root *Node, serv *DAGService) {
for _, l := range root.Links {
go func(lnk *Link) {
select {
case <-ctx.Done():
return
}
nd, err := lnk.GetNode(serv)
if err != nil {
log.Error(err)
return
}
FetchGraph(ctx, nd, serv)
}(l)
}
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment