Sha256: 3147342832a18499ec4a2cbbd53c93f0da182829aa45be42d5c2e84c782b632a

Contents?: true

Size: 996 Bytes

Versions: 15

Compression:

Stored size: 996 Bytes

Contents

# -*- coding: utf-8 -*-
require 'tengine/core'

# カーネルはイベントevent52_alt1を受け取ったらDBに保存。
# 対応するハンドラ群をすべて実行してすべてsubmitしたらACKを返す。
ack_policy(:after_all_handler_submit, :event52_alt1)

# このドライバでは自動テストの簡略化のために明示的に標準出力に対してputsを呼び出しています

driver :driver52_alt1_1 do
  on:event52_alt1 do
    STDOUT.puts "handler52_alt1_1 " << (ack? ? "acknowledged" : "unacknowledged")
    submit
  end
end

driver :driver52_alt1_2 do
  on:event52_alt1 do
    STDOUT.puts "handler52_alt1_2 " << (ack? ? "acknowledged" : "unacknowledged")
    # submit # submitしないのでこのDSL
  end
end

driver :driver52_alt1_3 do
  on:event52_alt1 do
    STDOUT.puts "handler52_alt1_3 " << (ack? ? "acknowledged" : "unacknowledged")
    submit
  end
end

# 上記はすべてsubmitするので通常はすべてのハンドラ実行後にACKを返す。

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
tengine_core-1.2.2 examples/uc52_never_commit_event_unless_all_handler_submit.rb
tengine_core-1.2.1 examples/uc52_never_commit_event_unless_all_handler_submit.rb
tengine_core-1.2.0 examples/uc52_never_commit_event_unless_all_handler_submit.rb
tengine_core-1.1.0 examples/uc52_never_commit_event_unless_all_handler_submit.rb
tengine_core-0.5.39 examples/uc52_never_commit_event_unless_all_handler_submit.rb
tengine_core-0.5.38 examples/uc52_never_commit_event_unless_all_handler_submit.rb
tengine_core-0.5.37 examples/uc52_never_commit_event_unless_all_handler_submit.rb
tengine_core-0.5.36 examples/uc52_never_commit_event_unless_all_handler_submit.rb
tengine_core-0.5.35 examples/uc52_never_commit_event_unless_all_handler_submit.rb
tengine_core-0.5.34 examples/uc52_never_commit_event_unless_all_handler_submit.rb
tengine_core-0.5.33 examples/uc52_never_commit_event_unless_all_handler_submit.rb
tengine_core-0.5.32 examples/uc52_never_commit_event_unless_all_handler_submit.rb
tengine_core-0.5.31 examples/uc52_never_commit_event_unless_all_handler_submit.rb
tengine_core-0.5.30 examples/uc52_never_commit_event_unless_all_handler_submit.rb
tengine_core-0.5.28 examples/uc52_never_commit_event_unless_all_handler_submit.rb