You can use
https://github.com/caolan/async#queue
with concurrency of 1
Regards MichaƂ Kruk

On Thu, Nov 22, 2012 at 1:11 PM, Ismael Gorissen
<[email protected]>wrote:

> Hi,
>
> I have some web services which call flurry api. To get some data from
> flurry api, I must wait 1 sec before each calls to the api.
> There is 6 actions on my web services
>
>    1. getActiveUsers
>    2. getSessionsNumberByDay
>    3. getNewUsers
>    4. getTotalActiveUsers
>    5. getTotalSessions
>    6. getTotalNewUsers
>
> On my web page I made 6 http request and between each request I'm waiting
> 1 sec.
>
> If this web page is display twice on the same time, I have a concurrency
> in the first http request.
> I want to implement "a semaphore" like on my web services, when a request
> is received and there is no request executed, is executed, if not, the
> request wait to be executed. The 6 actions must use the same semaphore.
>
> How can I implement this on node ?
>
> Thanks
>
> --
> 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
>

-- 
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

Reply via email to