You might be interested to look at https://godoc.org/github.com/juju/utils/parallel#Run, a slightly simpler approach to the same issue, and just about as general, I think.
On 15 March 2018 at 08:19, Sotirios Mantziaris <[email protected]> wrote: > since the lack of generics i am trying to avoid interface{} as much as > possible. > > On Thursday, March 15, 2018 at 1:03:14 AM UTC+2, [email protected] wrote: >> >> Hi Sotirios, >> >> Why not something like this? >> >> // Stops and returns if any error is encountered by a work function, >> otherwise returns nil. >> // Processes work at the pace of runtime.NumCPU() parallelization. >> func Process(callback func(interface{}), work ...func() (interface{}, >> error)) error >> >> Matt >> >> On Wednesday, March 14, 2018 at 3:54:24 PM UTC-5, Sotirios Mantziaris >> wrote: >>> >>> Hi, >>> >>> >>> i have created a package which uses the fork-join model to parallelize >>> work. >>> >>> Check out my blog and the Github repository. >>> >>> >>> Any feedback is highly welcome. >>> >>> >>> Thanks >>> >>> >>> > -- > You received this message because you are subscribed to the Google Groups > "golang-nuts" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > For more options, visit https://groups.google.com/d/optout. -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout.
