Sha256: 4d4820b389ec623727acb67fef9460eebf81953c7c08a7311676335f9dc7d428

Contents?: true

Size: 424 Bytes

Versions: 2

Compression:

Stored size: 424 Bytes

Contents

class BackAddHandler
  include Wamp::Worker::BackgroundHandler

  register"com.example.back.add", :add, { invoke: "roundrobin" }
  register"com.example.back.add.delay", :add_delay, { invoke: "roundrobin" }

  def add
    args[0] + args[1]
  end

  def add_delay
    progress 0.0
    sleep 0.1

    progress 0.25
    sleep 0.1

    progress 0.5
    sleep 0.1

    progress 0.75
    sleep 0.1

    args[0] + args[1]
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
wamp-worker-0.1.1 test/wamp_test/app/handlers/back_add_handler.rb
wamp-worker-0.1.0 test/wamp_test/app/handlers/back_add_handler.rb