How to translate the following sync pseudo code into async js code
result = []
for pid in r.smembers('active_prog'):
for prog_obj in r.hgetall("prog:" + pid):
for item_obj in r.hgetall("item:" + prog_obj['iid']):
prog_obj['items'].append(item_obj)
result.append(prog_obj)
return result
That's seems natural in sync programming:
- get some ids,
- get items by id
- get relevant information for each items and attach those info to them
- merge all items into an array and return
I've tried using MULTI but it seem doesn't work when the recursion goes deeper.
Is there any recommendation for learning programming in async paradigm?(preferably in js code rather than .net stuff)