Sha256: 516f8d52bfe4f88c6a4464eee5a3484fc497359d35643dab9d9faab79928a18a

Contents?: true

Size: 659 Bytes

Versions: 4

Compression:

Stored size: 659 Bytes

Contents

#
# !SLIDE :capture_code_output true
# One-way, asynchronous thread service

require 'example_helper'
begin
  Email.asir.transport = t =
    ASIR::Transport::Thread.new
  spawned_thread = nil
  t.after_thread_new = lambda do | transport, message, thread |
    spawned_thread = thread
    $stderr.puts "\n  #{$$}: Spawned Thread #{thread.inspect}"
  end

  pr Email.asir.send_email(:pdf_invoice,
                             :to => "user@email.com",
                             :customer => @customer)

  spawned_thread.join
end

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

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
asir-1.1.12 example/ex26.rb
asir-1.1.11 example/ex26.rb
asir-1.1.10 example/ex26.rb
asir-1.1.9 example/ex26.rb