File: container_class.rb

package info (click to toggle)
ruby-celluloid 0.18.0-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 848 kB
  • sloc: ruby: 7,579; makefile: 10
file content (35 lines) | stat: -rw-r--r-- 420 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
class SupervisionContainerHelper
  @queue = nil
  class << self
    def reset!
      @queue = Queue.new
    end

    def done!
      @queue << :done
    end

    def pop!
      @queue.pop
    end
  end
end

class MyContainerActor
  include Celluloid

  attr_reader :args

  def initialize(*args)
    @args = args
    ready
  end

  def running?
    :yep
  end

  def ready
    SupervisionContainerHelper.done!
  end
end