Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Threadtest
- include Cinch::Plugin
- listen_to :hooktest, :method => :hooktest
- match /threadtest nojoin/, :method => :test_nojoin
- match /threadtest join/, :method => :test_join
- def test_join(m)
- m.reply "Dispatching"
- t = bot.handlers.dispatch(:hooktest, m)
- t.each do |thread|
- thread.join
- end
- m.reply "Done"
- end
- def test_nojoin(m)
- m.reply "Dispatching"
- bot.handlers.dispatch(:hooktest, m)
- m.reply "Done"
- end
- def hooktest(m)
- m.reply "Hook fired"
- sleep 5
- m.reply "Hook finished firing"
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment