From b28d910db82ac1e8933bf6a7b0f52d28a293fbb6 Mon Sep 17 00:00:00 2001 From: Dmitry Kim Date: Tue, 11 Sep 2007 17:38:23 +0000 Subject: * (plugins/fish,translator) long-running actions made threaded to avoid blocking --- data/rbot/plugins/fish.rb | 6 +++--- data/rbot/plugins/translator.rb | 6 ++++-- 2 files changed, 7 insertions(+), 5 deletions(-) (limited to 'data/rbot/plugins') diff --git a/data/rbot/plugins/fish.rb b/data/rbot/plugins/fish.rb index dcd4a0e3..7cefff8b 100644 --- a/data/rbot/plugins/fish.rb +++ b/data/rbot/plugins/fish.rb @@ -110,8 +110,8 @@ plugin = BabelPlugin.new plugin.default_auth('cache', false) -plugin.map 'translate to :tolang *phrase' -plugin.map 'translate from :fromlang *phrase' +plugin.map 'translate to :tolang *phrase', :thread => true +plugin.map 'translate from :fromlang *phrase', :thread => true plugin.map 'translate cache :cmd', :action => :cache_mgmt, :auth_path => 'cache!', :requirements => { :cmd => /view|clear/ } -plugin.map 'translate :fromlang :tolang *phrase' +plugin.map 'translate :fromlang :tolang *phrase', :thread => true diff --git a/data/rbot/plugins/translator.rb b/data/rbot/plugins/translator.rb index c2b74eeb..299d6a0e 100644 --- a/data/rbot/plugins/translator.rb +++ b/data/rbot/plugins/translator.rb @@ -271,7 +271,8 @@ class TranslatorPlugin < Plugin TRANSLATORS.each_pair do |name, c| begin @translators[name] = c.new(@registry.sub_registry(name)) - map "#{name} :from :to *phrase", :action => :cmd_translate + map "#{name} :from :to *phrase", + :action => :cmd_translate, :thread => true rescue Exception warning _("Translator %{name} cannot be used: %{reason}") % {:name => name, :reason => $!} @@ -343,4 +344,5 @@ class TranslatorPlugin < Plugin end plugin = TranslatorPlugin.new -plugin.map 'translator :from :to *phrase', :action => :cmd_translator +plugin.map 'translator :from :to *phrase', + :action => :cmd_translator, :thread => true -- cgit v1.2.3