Sha256: 12fac9e8812caae24dfd984f1022cd0c3d5dd887a8f22cf736175254e202251a

Contents?: true

Size: 749 Bytes

Versions: 9

Compression:

Stored size: 749 Bytes

Contents

# !SLIDE :capture_code_output true
# One-way ZMQ service.

require 'example_helper'
require 'asir/transport/zmq'
begin
  zmq = ASIR::Transport::Zmq.new(:port => 31920,
                                 :encoder => ASIR::Coder::Marshal.new,
                                 :one_way => true)
  server_process do
    zmq.prepare_server!
    zmq.run_server!
  end
  UnsafeService.asir.transport = t = zmq
  pr UnsafeService.asir.do_it(":ok")
rescue ::Exception => err
  $stderr.puts "### #{$$}: ERROR: #{err.inspect}\n  #{err.backtrace * "\n  "}"
  raise
ensure
  zmq.close rescue nil; sleep 1; server_kill
end

# !SLIDE END
# EXPECT: : client process
# EXPECT: : server process
# EXPECT: UnsafeService.do_it => :ok
# EXPECT: : pr: nil
# EXPECT!: ERROR

Version data entries

9 entries across 9 versions & 2 rubygems

Version Path
asir_zmq-1.2.0 example/ex01.rb
asir_zmq-1.1.1 example/ex01.rb
asir_zmq-1.1.0 example/ex01.rb
asir-1.0.8 example/ex20.rb
asir-1.0.7 example/ex20.rb
asir-1.0.6 example/ex20.rb
asir-1.0.5 example/ex20.rb
asir-1.0.4 example/ex20.rb
asir-1.0.1 example/ex20.rb