Skip to content

Instantly share code, notes, and snippets.

@richardkmichael
Last active August 29, 2015 13:57
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save richardkmichael/9648257 to your computer and use it in GitHub Desktop.
Save richardkmichael/9648257 to your computer and use it in GitHub Desktop.
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