Skip to content

v0.4.0

Compare
Choose a tag to compare
@cszatmary cszatmary released this 22 Dec 19:06
· 1 commit to master since this release
7d30e22

New packages:

async: The new async package provides functionality for working with async operations. It provides the Group type which can be used to execute a list of related operations in parallel and collect the results.

Minor Changes:

progress:

  • Added ContextWithTrackerUsingKey and TrackerFromContextUsingKey which work the same as ContextWithTracker and TrackerFromContext but allow setting a custom context key.
  • Added RunOptions.TrackerKey and RunParallelOptions.TrackerKey which can be used to specify the key to use to retrieve the Tracker from the context.
  • RunParallel/RunParallelT now return results in the same order that they were run. These semantics are documented in the godoc and are part of the API contract now.

Breaking Changes:

command:

  • Command.Exec and Exec now require a context.Context as the first parameter. This context is used to kill the command process if the context becomes done before the process completes on its own.

progress:

  • Run/RunT and RunParallel/RunParallelT no longer return immediately if the context becomes done but rather wait for the running functions to complete. This behaviour was deemed undesirable as it meant that operations were still running concurrently after Run/RunParallel returned which might be unexpected. The semantics now are that when Run/RunParallel return, there are no concurrent operations running. It is up to callers to ensure that their functions use the context properly to handle timeouts/cancellations.
  • RunParallel/RunParallelT no longer return immediately if CancelOnError is true but wait for the running functions to complete for the same reasons as describe in the previous point.