Sha256: 1794bd4541718b044d99bac42e2f589386da392c757b1753b3d9b90b90ef84ad

Contents?: true

Size: 685 Bytes

Versions: 1

Compression:

Stored size: 685 Bytes

Contents

EVAL_APP_ROOT = File.expand_path(File.join(File.dirname(__FILE__) + "/.."))
["bin","worker","lib"].each { |x| $LOAD_PATH.unshift(EVAL_APP_ROOT + "/#{x}")}
WORKER_ROOT = EVAL_APP_ROOT + "/worker"

require "packet"
class Foo
  def receive_data p_data
    ask_worker(:no_proxy_worker,:data => p_data, :type => :request)
  end

  def worker_receive p_data
    send_data "#{p_data[:data]}\n"
  end

  def show_result p_data
    send_data("#{p_data[:response]}\n")
  end

  def connection_completed
  end

  def post_init
  end

  def wow
    puts "Wow"
  end
end

Packet::Reactor.run do |t_reactor|
  t_reactor.start_server("localhost", 11006,Foo) do |instance|
    instance.wow
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
packet-0.1.0 bin/runner.rb