graph-gophers / dataloader

Implementation of Facebook's DataLoader in Golang
MIT License
1.21k stars 75 forks source link

Make BatchedLoader configurable #2

Closed tonyghita closed 7 years ago

tonyghita commented 7 years ago

The intention of this PR is to offer a mechanism that provides configurable internals (e.g. Cache implementation, capacities for batch and input channels, time to wait before triggering batch).

Please let me know what you think.


This change is Reviewable

tonyghita commented 7 years ago

I'm not sure why the tests are failing in travis... they pass when run on my local branch. Thoughts?

nicksrandall commented 7 years ago

I'm ok with these changes. I'm going to merge and then fix travis. My guess is that travis is failing because of the examples are not compiling.

nicksrandall commented 7 years ago

It was a race condition on the counter. I changed the lock to be an RWMutex to account for that. Thanks again for your contributions!

tonyghita commented 7 years ago

Great find, thank you!