Benn Huang

Results 382 comments of Benn Huang

Agree above. The method `CachePage` is NOT safe in high-concurrency. It will cause wrong-repeating data in response. There is a simple code demo: ``` r.GET("/data", cache.CachePage(redisCache, time.Second * 5, func...

> > Agree above. The method `CachePage` is NOT safe in high-concurrency. It will cause wrong-repeating data in response. There is a simple code demo: > > ``` > >...

> lgtm Thank you for your encouragement and keep me motivated to do the rest, such as docs, more methods updating...

### Benchmark Previous(master): ``` goos: darwin goarch: amd64 pkg: github.com/samber/lo cpu: Intel(R) Core(TM) i7-9750H CPU @ 2.60GHz BenchmarkMap/lo.Map-12 21 53455758 ns/op 39998870 B/op 1000001 allocs/op BenchmarkMap/lop.Map-12 4 276965265 ns/op 119999904...

If you have time please get me some reviews and suggestions? @samber Currently, I don't have any idea about performance improvement, and I think @Azer0s's work is great. Maybe the...

> Thoughts on adjusting the API to use a more idiomatic option interface like `With...`.. i.e. `WithConcurrency` > > I made some adjustments to this branch so lmk what you...

Now we can do something like this: 1) simple usage: ```go lop.Map(list, transform, lop.WithConcurrency(20)) ``` 2) as variate ```go option := lop.WithConcurrency(20) lop.Map(list, transform, option) ``` 3) in the `if`...

Any things above were implemented, already for review. @samber

> Good feature! When will this be merged? @samber

Good job. But maybe the API that implemented with method `With()` is a little complex to use? I think expandable optional parameters might be more suitable: ```go func Map[T any,...