Uh oh!
There was an error while loading. Please reload this page.
Add redis pub/sub to project - #6
Conversation
mohammadranjbarz
commented
Dec 25, 2020
This is not working yet, I think I need some pair programming with you , it's getting complicated for me to understand what should I do |
| await (async function () { | ||
| for await (const {channel, message} of subscribe.receive()) { | ||
| console.log({channel, message:message}) | ||
| } | ||
| })(); |
There was a problem hiding this comment.
Doesn't this do the job? Since the parent function is already defined as async.
| await(asyncfunction(){ | |
| forawait(const{channel, message}ofsubscribe.receive()){ | |
| console.log({channel,message:message}) | |
| } | |
| })(); | |
| forawait(const{channel, message}ofsubscribe.receive()){ | |
| console.log({channel,message:message}) | |
| } |
| export const addTaskToRedis = async (task:Task)=>{ | ||
| return publish(task.name, task) | ||
| } |
There was a problem hiding this comment.
IMO, this module should not know anything about tasks. It should be concerned with saving and receiving data from Redis. We need another module/package to handle connecting to tasks. WDYT?
There was a problem hiding this comment.
You are right, I should separate the concerns
jamiri
commented
Dec 25, 2020
Sorry for commenting on a WIP PR. Just wanted to apply the changes in the meanwhile if you agree. Thanks @mohammadranjbarz . |
mohammadranjbarz
commented
Dec 26, 2020
|
mohammadranjbarz
commented
Dec 28, 2020
@jamiri |
No description provided.