Function
newVertex
(id int, work func(ctx context.Context) error, options ...VertexOption)
Source from the content-addressed store, hash-verified
| 28 | } |
| 29 | |
| 30 | func 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 | |
| 45 | func (v *vertex) execute(ctx context.Context) error { |
| 46 | if v.logger != nil { |
Tested by
no test coverage detected