Skip to content

Commit

Permalink
feat: better circular dependency detection
Browse files Browse the repository at this point in the history
  • Loading branch information
pavelsmejkal committed May 2, 2024
1 parent 68aaa62 commit 09e3692
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions plumber.go
Original file line number Diff line number Diff line change
Expand Up @@ -163,8 +163,7 @@ func (d *D[T]) Error() error {
return err
}

// Resolved return true if current value was resolved and is valid
// In case that current value is just being resolved it return false to not trigger infinite loop during cyclic dependency
// Iterate iterates dependect graph, when callback returns true iterator will continue down stream
func (d *D[T]) Iterate(callback func(dep Dependency) bool) {
for _, dep := range d.deps {
if !callback(dep) {
Expand Down

0 comments on commit 09e3692

Please sign in to comment.