Sorry, I don't know how to express in more detail.
But the async is at FE server, something like
sendtask(task, function (err, result) { ... .});
The task (maybe a simple javascript object, serializable to JSON), goes to
the task queue, and the callback is assigned to task id.
If the response queue system/module has support of read message with
callback, there is another part of FE server, that did
responsequeue.readmessage(function (err, message) {
});
and giving the task id it will call back the callback ;-)
I wrote some samples with different approaches, not exactly the depicted
above, but it could give more context
http://ajlopez.wordpress.com/2013/05/30/aplicaciones-distribuidas-y-node-js/
Angel "Java" Lopez
@ajlopez
On Thu, Dec 26, 2013 at 8:04 AM, AlainM <[email protected]> wrote:
> How does this fit in NODE.JS??
>
> What you describe does, not seem like async programming at all to me...
>
>
> Angel Java Lopez <[email protected]> escreveu:
>
>> I prefer
>>
>> Available worker pulls task
>>
>> over
>>
>> Available worker is notified
>>
>> The first one could use a queue, as you mentioned. So any other process
>> (a programmer, a supervisor program, etc...) can launch workers, and the
>> workers only need to know:
>>
>> - The queue having pending tasks
>> - Maybe a queue where to put the response
>> (the task id, and the response queue could be in the original message in
>> task queue)
>>
>> There are queues that "reprocess" the message if the message is not ACKed
>> in x milliseconds. The worker, at finish the tasks, should ACK the original
>> message
>>
>> FE or queue servers DON'T know the existence of workers. That could be
>> treated as an orthogonal problem.
>>
>> A use case: at night, someone launch 40 worker programs in 40 physical
>> machines, and the process is the same: elastic worker topology.
>>
>> The load balance is at each worker, it knows where is free to get a
>> message from the task queue.
>>
>> FE is reading the response queue, and associate the task id with a
>> pending response callback, to send the response
>>
>> Makes sense? (in bad English ;-)
>>
>> Angel "Java" Lopez
>> @ajlopez
>>
>>
>>
>> On Thu, Dec 26, 2013 at 4:49 AM, Floby <[email protected]> wrote:
>>
>>> This is an interesting subject.
>>> I would look into the ømq guide for ideas, especially the part on
>>> pipelines. Even if you don't chose ømq as your supporting technology, their
>>> docs have some very useful material for distributed architectures.
>>>
>>> --
>>> --
>>> Job Board: http://jobs.nodejs.org/
>>> Posting guidelines:
>>> https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
>>> You received this message because you are subscribed to the Google
>>> Groups "nodejs" group.
>>> To post to this group, send email to [email protected]
>>> To unsubscribe from this group, send email to
>>> [email protected]
>>> For more options, visit this group at
>>> http://groups.google.com/group/nodejs?hl=en?hl=en
>>>
>>> ---
>>> You received this message because you are subscribed to the Google
>>> Groups "nodejs" group.
>>> To unsubscribe from this group and stop receiving emails from it, send
>>> an email to [email protected].
>>> For more options, visit https://groups.google.com/groups/opt_out.
>>>
>>
>>
> --
> E-mail enviado do meu celular usando Kaiten Mail. Por favor, desculpe
> minha brevidade.
>
> --
> --
> Job Board: http://jobs.nodejs.org/
> Posting guidelines:
> https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
> You received this message because you are subscribed to the Google
> Groups "nodejs" group.
> To post to this group, send email to [email protected]
> To unsubscribe from this group, send email to
> [email protected]
> For more options, visit this group at
> http://groups.google.com/group/nodejs?hl=en?hl=en
>
> ---
> You received this message because you are subscribed to the Google Groups
> "nodejs" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> For more options, visit https://groups.google.com/groups/opt_out.
>
--
--
Job Board: http://jobs.nodejs.org/
Posting guidelines:
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en
---
You received this message because you are subscribed to the Google Groups
"nodejs" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.