example/ex18.rb in asir-0.2.0 vs example/ex18.rb in asir-1.0.1
- old
+ new
@@ -13,23 +13,23 @@
$stderr.puts "message = #{message.inspect}"
file.send_message(message)
server_process do
tcp.prepare_server!
tcp.run_server!
- end; sleep 2
+ end
end
- Email.client.transport = t =
+ Email.asir.transport = t =
ASIR::Transport::Retry.new(:transport => tcp,
:try_sleep => 1,
:try_sleep_increment => 2,
:try_max => 3,
:before_retry => start_server_proc
)
- pr Email.client.send_email(:pdf_invoice,
+ pr Email.asir.send_email(:pdf_invoice,
:to => "user@email.com", :customer => 123)
sleep 1
- pr Email.client.send_email(:pdf_invoice,
+ pr Email.asir.send_email(:pdf_invoice,
:to => "user2@email.com", :customer => 456)
sleep 1
rescue ::Exception => err
$stderr.puts "ERROR: #{err.inspect}\n #{err.backtrace * "\n "}"
raise
@@ -48,10 +48,10 @@
# EXPECT/: : Email.send_mail :pdf_invoice .*:to=>"user2@email.com"
# EXPECT: : pr: :ok
# EXPECT: service.log" contents:
# EXPECT: --- !ruby/object:ASIR::Message
# EXPECT: :transport_exceptions:
-# EXPECT: ASIR::Error: Cannot connect to ASIR::Transport::TcpSocket tcp://127.0.0.1:
+# EXPECT: Cannot connect to ASIR::Transport::TcpSocket tcp://127.0.0.1:
# EXPECT: arguments:
# EXPECT: - :pdf_invoice
# EXPECT/: :to: user@email.com
# EXPECT/: :customer: 123
# EXPECT!/: :to: user2@email.com