add additional entrypoint to TThreadPoolServer with easy exception handling
authorKevin Clark <kclark@apache.org>
Wed, 18 Jun 2008 00:49:38 +0000 (00:49 +0000)
committerKevin Clark <kclark@apache.org>
Wed, 18 Jun 2008 00:49:38 +0000 (00:49 +0000)
commit104584ee7fcda914d08526f50eedd02ee374b7f8
treeaedf0bbb3fbf3585aa35d528181936f51a943d82
parent28580f4544659e3fba61fc613e6507ba8970e1ea
add additional entrypoint to TThreadPoolServer with easy exception handling

An additional method #serve_rescuable is added, which relays any exceptions
that happen in worker threads to the caller, where they can be handled
directly. 'retry' works too, allowing code like:

  begin
    server.rescuable_serve
  rescue StandardError => e
    puts "got exception: #{e.inspect}"
    ## do something
    retry
  end

The semantics of TThreadPoolServer#serve remain the same.

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@668891 13f79535-47bb-0310-9956-ffa450edef68
lib/rb/lib/thrift/server/tserver.rb