Sha256: c8ee5e64f8edcd3fb1c2d1d6a4f6989c91484be826c30195526b2f3f8c9251a4

Contents?: true

Size: 951 Bytes

Versions: 30

Compression:

Stored size: 951 Bytes

Contents

# !SLIDE :capture_code_output true
# Socket service with unsafe Exception.

require 'example_helper'
begin
  tcp = ASIR::Transport::TcpSocket.new(:port => 31919,
                                       :encoder => ASIR::Coder::Marshal.new)
  server_process do
    tcp.prepare_server!
    tcp.run_server!
  end
  UnsafeService.asir.transport = t = tcp
  pr UnsafeService.asir.do_it("exit 999; :ok")
  sleep 1
rescue ::ASIR::Error::Unforwardable => err
  $stderr.puts "### #{$$}: Unforwardable ERROR: #{err.inspect}}"
rescue ::Exception => err
  $stderr.puts "### #{$$}: ERROR: #{err.inspect}\n  #{err.backtrace * "\n  "}"
  raise
ensure
  file.close rescue nil;
  tcp.close rescue nil; sleep 1
  server_kill
#  puts "\x1a\n#{service_log.inspect} contents:"
#  puts File.read(service_log)
end

# !SLIDE END
# EXPECT: : client process
# EXPECT: : server process
# EXPECT!: : pr: :ok
# EXPECT: Unforwardable ERROR: #<ASIR::Error::Unforwardable: SystemExit

Version data entries

30 entries across 30 versions & 1 rubygems

Version Path
asir-1.1.3 example/ex19.rb
asir-1.1.2 example/ex19.rb
asir-1.1.1 example/ex19.rb
asir-1.1.0 example/ex19.rb
asir-1.0.8 example/ex19.rb
asir-1.0.7 example/ex19.rb
asir-1.0.6 example/ex19.rb
asir-1.0.5 example/ex19.rb
asir-1.0.4 example/ex19.rb
asir-1.0.1 example/ex19.rb