Sha256: 166aa126be8c1ad1e248af84c0af933f0887eaab1b30973fb9e6ee1d10575525

Contents?: true

Size: 808 Bytes

Versions: 1

Compression:

Stored size: 808 Bytes

Contents

# examples/example_agent.rb
#
# NOTE: This agent is meant to be loaded
#       by the agent_watcher.rb be file.
#       To do that first have AgentWatcher running
#       then `cp example_agent.rb agents`
#       AgentWatcher will see the new file arrive
#       in the `agents` folder, will determine that the
#       new file contains an Agent99 subclass, will
#       load it, create a new instance of the class and
#       finally run the new instance within its own
#       thread as part of the AgentWatcher process.
#

require_relative '../../lib/agent99'

class ExampleAgent < Agent99::Base
  TYPE = :server
  
  def capabilities = %w[ rubber_stamp yes_man example ]
  
  def receive_request
    logger.info "Example agent received request: #{payload}"
    send_response(status: 'success')
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
agent99-0.0.3 examples/example_agent.rb