graph-gophers / dataloader

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

Non-memory cache and close context #105

Open eaglemoor opened 1 year ago

eaglemoor commented 1 year ago

I found 2 problems in data loader.

  1. We can't use non-memory cache, because cache save lambda function.
  2. If user close context, batchFunc return error, and this error will be used in cache for all batch keys.

I fix it with DataCache interface and detachContext. PR https://github.com/graph-gophers/dataloader/pull/104