Sha256: b82901bfbb5dccf76e485b5c3b5bea859ef961ea1043697569d6409ce89302e5

Contents?: true

Size: 770 Bytes

Versions: 30

Compression:

Stored size: 770 Bytes

Contents

# !SLIDE :capture_code_output true
# One-way, named pipe service with signature

require 'example_helper'
begin
  File.unlink(service_pipe = "service.pipe") rescue nil
  Email.asir.transport = t =
    ASIR::Transport::File.new(:file => service_pipe)
  t.encoder =
    ASIR::Coder::Chain.new(:encoders =>
      [ ASIR::Coder::Marshal.new,
        s = ASIR::Coder::Sign.new(:secret => 'abc123'),
        ASIR::Coder::Yaml.new,
      ])
  t.prepare_pipe_server!
  server_process do
    t.run_pipe_server!
  end
  pr Email.asir.send_email(:pdf_invoice, :to => "user@email.com", :customer => @customer)
ensure
  t.close; sleep 1; server_kill
end

# !SLIDE END
# EXPECT: : client process
# EXPECT: : server process
# EXPECT: : Email.send_mail :pdf_invoice
# EXPECT: : pr: nil

Version data entries

30 entries across 30 versions & 1 rubygems

Version Path
asir-1.2.11 example/ex07.rb
asir-1.2.10 example/ex07.rb
asir-1.2.9 example/ex07.rb
asir-1.2.8 example/ex07.rb
asir-1.2.7 example/ex07.rb
asir-1.2.6 example/ex07.rb
asir-1.2.5 example/ex07.rb
asir-1.2.3 example/ex07.rb
asir-1.2.2 example/ex07.rb
asir-1.2.1 example/ex07.rb
asir-1.2.0 example/ex07.rb
asir-1.1.12 example/ex07.rb
asir-1.1.11 example/ex07.rb
asir-1.1.10 example/ex07.rb
asir-1.1.9 example/ex07.rb
asir-1.1.8 example/ex07.rb
asir-1.1.7 example/ex07.rb
asir-1.1.6 example/ex07.rb
asir-1.1.5 example/ex07.rb
asir-1.1.4 example/ex07.rb