Method: ContentServer::FileCopyClient#initialize
- Defined in:
- lib/content_server/queue_copy.rb
#initialize(host, port) ⇒ FileCopyClient
Returns a new instance of FileCopyClient.
239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 |
# File 'lib/content_server/queue_copy.rb', line 239 def initialize(host, port) @local_queue = Queue.new @tcp_client = Networking::TCPClient.new(host, port, method(:handle_message)) @file_receiver = FileReceiver.new(method(:done_copy), method(:abort_copy), method(:reset_copy)) @local_thread = Thread.new do loop do pop_data = @local_queue.pop $process_vars.set('File Copy Client queue', @local_queue.size) handle(pop_data) end end @local_thread.abort_on_exception = true Log.debug3("initialize FileCopyClient host:%s port:%s", host, port) end |