Sha256: cdcbd3e9ad7f34fee353a9fc6294bcad67223fd3e760a337f60b6fd2ad5e700c

Contents?: true

Size: 416 Bytes

Versions: 4

Compression:

Stored size: 416 Bytes

Contents

# encoding: utf-8

$: << File.expand_path('../../lib', __FILE__)

require 'bundler/setup'
require 'mikka'


class Worker < Mikka::Actor
  def receive(message)
    puts "#{context.uuid} Work on #{message}"
  end
end

balancer = Mikka.load_balancer(:type => Worker, :count => 4)

10.times do |i|
  balancer << "item #{i}"
end

balancer << Mikka::Messages.broadcast("a message to everyone")

Mikka.registry.shutdown_all

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
mikka-1.1.1-java examples/load_balancing2.rb
mikka-1.1.0-java examples/load_balancing2.rb
mikka-1.0.1-java examples/load_balancing2.rb
mikka-1.0.0-universal-darwin-11 examples/load_balancing2.rb