Sha256: 6dc7d9bbbcf201ff14158831c9f7aaf320700ce57b835094ec5519fc136d0dba

Contents?: true

Size: 474 Bytes

Versions: 15

Compression:

Stored size: 474 Bytes

Contents

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

# これは driver62と違って、複数のプロセスが同時に数を数えても正しく+1していきます
driver :driver64 do
  session.update(:foo => 100) # ドライバ登録時にそのセッションに キー:foo に対して 値100 を設定する。

  on:event64 do
    session.update(:retry => 2) do |hash|
      hash[:foo] = hash[:foo] + 1
      # hash[:foo] += 1 # と書いても良い
    end
  end
end

Version data entries

15 entries across 15 versions & 1 rubygems

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