lordthorzonus / php-dataloader

Port of the Facebook's DataLoader
15 stars 5 forks source link

Use PSR-16 SimpleCacheInterface instead of CacheMapInterface #9

Open acelot opened 5 years ago

acelot commented 5 years ago

This would improve interoperability and compatibility with third-party caching packages.

enumag commented 5 years ago

👎 PSR-16 is a synchronous API. Not suitable to be used in async applications with promises.

acelot commented 5 years ago

But I see, that CacheMapInterface doesn't use promises.

enumag commented 5 years ago

That's most likely a slight oversight of the author. I'm guessing he just implemented the simple in-memory CacheMap and added an interface as a good practice. But it didn't occur to him that different implementations would need to use promises.