From 929a016b4d571531897ca7e97c39a98e592a8cc7 Mon Sep 17 00:00:00 2001 From: Jamis Buck Date: Sat, 18 Feb 2006 04:40:48 +0000 Subject: [PATCH] Add Actor#connect! method for working around lazy connection establishing git-svn-id: http://svn.rubyonrails.org/rails/tools/switchtower@3601 5ecf4fe2-1ee6-0310-87b1-e25e094e27de --- CHANGELOG | 2 ++ lib/switchtower/actor.rb | 8 ++++++++ 2 files changed, 10 insertions(+) diff --git a/CHANGELOG b/CHANGELOG index f828eb10..f1f66595 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,5 +1,7 @@ *0.11.0* *SVN* +* Add Actor#connect! method for working around lazy connection establishing + * Make sure IO::TRUNC is specified for Net::SFTP uploads (#3510) * Add branch support to CVS [jeremy@hinegardner.org] (#3596) diff --git a/lib/switchtower/actor.rb b/lib/switchtower/actor.rb index 61c61e70..35a6dfdc 100644 --- a/lib/switchtower/actor.rb +++ b/lib/switchtower/actor.rb @@ -326,6 +326,14 @@ module SwitchTower self.class.default_io_proc end + # Used to force connections to be made to the current task's servers. + # Connections are normally made lazily in SwitchTower--you can use this + # to force them open before performing some operation that might be + # time-sensitive. + def connect!(options={}) + execute_on_servers(options) { } + end + def metaclass class << self; self; end end