MCPcopy Create free account
hub / github.com/DoNewsCode/core / newVertex

Function newVertex

dag/vertex.go:30–43  ·  view source on GitHub ↗
(id int, work func(ctx context.Context) error, options ...VertexOption)

Source from the content-addressed store, hash-verified

28}
29
30func newVertex(id int, work func(ctx context.Context) error, options ...VertexOption) *vertex {
31 vertex := &vertex{
32 id: id,
33 work: work,
34 done: make(chan struct{}),
35 }
36 for _, f := range options {
37 f(vertex)
38 }
39 if vertex.name == "" {
40 vertex.name = "vertex-" + strconv.Itoa(id)
41 }
42 return vertex
43}
44
45func (v *vertex) execute(ctx context.Context) error {
46 if v.logger != nil {

Callers 1

AddVertexMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected