Last active
August 29, 2015 13:57
-
-
Save richardkmichael/9648257 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'bundler/setup' | |
require 'celluloid/autostart' | |
require 'celluloid/probe' | |
Celluloid.logger = ::Logger.new './celluloid.log' | |
class UselessActor | |
include Celluloid | |
end | |
class MonitoringActor | |
include Celluloid | |
include Celluloid::Logger | |
include Celluloid::Notifications | |
def initialize | |
subscribe(/#{Celluloid::Probe::NOTIFICATIONS_TOPIC_BASE.chomp '%s'}/, :write_message) | |
# subscribe(Celluloid::Probe::NOTIFICATIONS_TOPIC_BASE, :write_message) | |
# subscribe(/celluloid\.events\..+/, :write_message) | |
end | |
def write_message message, args | |
info "#{message} #{args}" | |
end | |
end | |
m = MonitoringActor.new | |
Celluloid::Probe.run | |
p = UselessActor.new # Expect a probe message about the Actor creation. | |
sleep |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment