Sha256: c43118bf8c8020e3fcf6b04badbd23f979ca01956467e2c1d78ae1fd35902bf7

Contents?: true

Size: 659 Bytes

Versions: 8

Compression:

Stored size: 659 Bytes

Contents

require 'rubygems'
require 'bundler'
Bundler.setup

require 'dcell'
DCell.start :id => 'benchmark_receiver', :addr => 'tcp://127.0.0.1:2043'

class AsyncReceiver
  include Celluloid
  attr_reader :count

  def initialize(n, actor)
    @n, @actor = n, actor
    @count = 0
  end

  def increment
    @count += 1
    @actor.async.complete if @count == @n
    @count
  end
end

class Progenator
  include Celluloid

  def spawn_async_receiver(n, actor)
    AsyncReceiver.new(n, actor)
  end
end

class BenchmarkApplication < Celluloid::SupervisionGroup
  supervise DCell::SupervisionGroup
  supervise Progenator, :as => :progenator
end

BenchmarkApplication.run

Version data entries

8 entries across 8 versions & 2 rubygems

Version Path
dcell-0.16.1 benchmarks/receiver.rb
stn-dcell-0.16.0 benchmarks/receiver.rb
dcell-0.16.0 benchmarks/receiver.rb
dcell-0.16.0.pre benchmarks/receiver.rb
dcell-0.15.0 benchmarks/receiver.rb
dcell-0.15.0.pre benchmarks/receiver.rb
dcell-0.14.0 benchmarks/receiver.rb
dcell-0.13.0 benchmarks/receiver.rb