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
✨ [parallelisation] Define a transformation group (#693)
<!--
Copyright (C) 2020-2022 Arm Limited or its affiliates and Contributors.
All rights reserved.
SPDX-License-Identifier: Apache-2.0
-->
### Description
- Add a transform group
- reuse groups to define worker pools
### Test Coverage
<!--
Please put an `x` in the correct box e.g. `[x]` to indicate the testing
coverage of this change.
-->
- [x] This change is covered by existing or additional automated tests.
- [ ] Manual testing has been performed (and evidence provided) as
automated testing was not feasible.
- [ ] Additional tests are not required for this change (e.g.
documentation update).
Copy file name to clipboardExpand all lines: utils/collection/search.go
+16-4Lines changed: 16 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -71,8 +71,10 @@ func AnyFunc[S ~[]E, E any](s S, f func(E) bool) bool {
71
71
returnconditions.Any()
72
72
}
73
73
74
+
typeFilterFunc[Eany] func(E) bool
75
+
74
76
// Filter returns a new slice that contains elements from the input slice which return true when they’re passed as a parameter to the provided filtering function f.
err=commonerrors.WrapError(commonerrors.ErrUnexpected, subErr, "an error occurred whilst handling a job")
273
-
return
274
-
}
275
-
276
-
err=DetermineContextError(ctx)
277
-
iferr!=nil {
278
-
return
279
-
}
280
-
281
-
ifok {
282
-
results<-result
283
-
}
268
+
// WorkerPool parallelises an action using a worker pool of the size provided by numWorkers and retrieves all the results when all the actions have completed. It is similar to Parallelise but it uses generics instead of reflection and allows you to control the pool size
// WorkerPool parallelises an action using a worker pool of the size provided by numWorkers and retrieves all the results when all the actions have completed. It is similar to Parallelise but it uses generics instead of reflection and allows you to control the pool size
0 commit comments