summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDmitry Kim <dmitry point kim at gmail point com>2007-09-11 17:38:23 +0000
committerDmitry Kim <dmitry point kim at gmail point com>2007-09-11 17:38:23 +0000
commitb28d910db82ac1e8933bf6a7b0f52d28a293fbb6 (patch)
treed5f1f656b887ac097c652763974531389b88b80d
parenta6738b25dbe4f8eee9223a60622abac5ac6108e5 (diff)
* (plugins/fish,translator) long-running actions made threaded to avoid blocking
-rw-r--r--data/rbot/plugins/fish.rb6
-rw-r--r--data/rbot/plugins/translator.rb6
2 files changed, 7 insertions, 5 deletions
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