Sha256: dc4db16c16bb70ece93318b8e0955d9a0bee265f1966020bbd9b20de19e063eb

Contents?: true

Size: 1.55 KB

Versions: 2

Compression:

Stored size: 1.55 KB

Contents

#!/usr/bin/ruby
#############################################################################
#
# $Id: sobsd.rb 4 2008-08-26 15:59:44Z colin $
#
# Author:: Colin Steele (colin@colinsteele.org)
# Homepage::  
# 
# TODO: info 
#
#----------------------------------------------------------------------------
#
#      Copyright (C) 2008 by Colin Steele. All Rights Reserved.
#                        colin@colinsteele.org
# 
# This program is free software; you can redistribute it and/or modify
# it under the terms of either: 1) the GNU General Public License
# as published by the Free Software Foundation; either version 2 of the
# License, or (at your option) any later version; or 2) Ruby's License.
# 
# See the file COPYING for complete licensing information.
#
#---------------------------------------------------------------------------
#
# 
#############################################################################

require 'rubygems'
require 'homeq'

# Gives us easy access to log, system and config.
include HomeQ

# This is a client's main way of interfacing with HomeQ - the JOB
class MyJob < HomeQ::SOBS::Job
  # This method is called when a job has been received and needs to be
  # worked on.
  def run
    super
    puts payload
  end
end

# This tells the system who we are - what queue this process owns
config.queue_name('consumer')

# Install our handler for jobs we get from the "server" queue
sys.handlers['server'] = MyJob

# The config file is found here.  This can also be specified with -c FILE
# on the command line.
sys.config_file = 'homeq.cfg'
sys.start

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
homeq-1.1.5 extras/simple_consumer.rb
homeq-1.1.4 extras/simple_consumer.rb