If I understand correctly, lets say I have an array of objects to save to redis:
const processedStandings: Standings[] = processStandings(league, data)
for (const processedStanding of processedStandings){
await standingsRepository.save(processedStandings)
}
What would be the optimal approach to save a bunch of objects?
I see a node article about auto-pipelining:
https://www.npmjs.com/package/redis
What that mean I could do this using premises. So something like:
const promises: Promise[] = {
return processedStandings.map(processedStanding => {
await standingsRepository.save(processedStandings)
})
}
const results: number[] = await Promise.all(promises);
But in this case i believe I just do requests in parallel. But no auto pipelining is done?