cinchrb / cinch

The IRC Bot Building Framework
http://www.rubydoc.info/gems/cinch
MIT License
1k stars 180 forks source link

Best way to delay sending a response? #225

Closed bazz1tv closed 8 years ago

bazz1tv commented 8 years ago

If I want to "queue" something for the bot to write (it's in an event handler), say maybe 1 second delay, is there an API for that? Or should I manually handle this somehow?

Using a "timer-hook" seems a little bit much

dominikh commented 8 years ago

Just sleep? Each handler invocation runs in its own thread, so sleeping in a handler won't impact the processing of other messages. If you want to continue in the same handler after queuing, queue in a new thread.

bazz1tv commented 8 years ago

thanks dom