You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
However, while iterating though the channel if you return early you will leak a go routine. This should probably be updated to allow for cancellation via context and follow an iterator pattern (soft suggestion):
I have a question about the suggested implementation: Why are we making a separate iterator? Why no let AllLocations accept a context, like this (example from the directory iterator):
Today the
LocationResolver
returns a channel of locations:However, while iterating though the channel if you return early you will leak a go routine. This should probably be updated to allow for cancellation via context and follow an iterator pattern (soft suggestion):
Where the caller would now be able to coordinate cancellation for correct usage:
Alternatively AllLocations can be a slice, which is simpler, but may cause memory pressures for images with many files:
The text was updated successfully, but these errors were encountered: