module Ragent::Plugin

Attributes

plugin_name[R]

Public Class Methods

included(klass) click to toggle source
# File lib/ragent/plugin.rb, line 4
def self.included(klass)
  klass.send(:include, Ragent::Logging)
  klass.send(:include, Celluloid)
  klass.send(:include, Celluloid::Notifications)
  klass.send(:finalizer, :stop)
  klass.send(:extend, Ragent::CommandHelpers)
  klass.extend(ClassMethods)
end
new(ragent, plugin_name:) click to toggle source
# File lib/ragent/plugin.rb, line 24
def initialize(ragent, plugin_name:)
  @plugin_name=plugin_name
  @ragent = ragent
  @logger = ragent.logger
  self.class.prepared_commands.each do |cmd|
    @ragent.commands.add(cmd = Ragent::Command.new(cmd.merge(recipient: self)))
  end
end

Public Instance Methods

agent(type:, as:, args: []) click to toggle source
# File lib/ragent/plugin.rb, line 39
def agent(type:, as:, args: [])
  @ragent.supervisor.supervise(
    type: type,
    as: as,
    args: args
  )
end
agents(name) click to toggle source
# File lib/ragent/plugin.rb, line 47
def agents(name)
  Celluloid::Actor[name]
end
configure(*args, &block) click to toggle source
# File lib/ragent/plugin.rb, line 33
def configure(*args, &block); end
start() click to toggle source
# File lib/ragent/plugin.rb, line 35
def start; end
stop() click to toggle source
# File lib/ragent/plugin.rb, line 37
def stop; end