Sha256: 9c633a1dc8f610b20953a63755864ece65adedb1c73d4e19ec37b82f5d2d6133

Contents?: true

Size: 645 Bytes

Versions: 4

Compression:

Stored size: 645 Bytes

Contents

require 'rubygems'
require 'bundler'
Bundler.setup

require 'dcell'
DCell.setup :id => 'benchmark_receiver', :addr => 'tcp://127.0.0.1:12345'

class AsyncReceiver
  include Celluloid
  attr_reader :count

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

  def increment
    @count += 1
    @actor.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::Application
  supervise DCell::Application
  supervise Progenator, :as => :progenator
end

BenchmarkApplication.run

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
dcell-0.9.0 benchmarks/receiver.rb
dcell-0.8.0 benchmarks/receiver.rb
dcell-0.7.1 benchmarks/receiver.rb
dcell-0.0.1 benchmarks/receiver.rb