Unless it's asynchronous, handlingEvent will always be no, JS is 
single-threaded.


On Sunday, 26 de January de 2014 at 21:07, Mark Hahn wrote:

> Debugging code is your best prevention.
> 
> Otherwise you can do something like ...
> 
> handlingEvent = no
> 
> emitter.on 'event', -> 
>     if handlingEvent then return
> 
>     handlingEvent = yes
> 
>     blah.blah.blah()
> 
>     handlingEvent = no
> 
> 
> 
> On Sun, Jan 26, 2014 at 11:38 AM, FirstName LastName <[email protected] 
> (mailto:[email protected])> wrote:
> > Is there any way to prevent spam requests like such:
> > 
> > while(true){
> >     client.emit('event', 'urbeingflooded');
> > }
> > 
> > 
> > -- 
> > -- 
> > 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] 
> > (mailto:[email protected])
> > To unsubscribe from this group, send email to
> > [email protected] 
> > (mailto:nodejs%[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] 
> > (mailto:nodejs%[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.

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

Reply via email to