Hi Jeff,
this moved things further, but still I can't send messages correctly.
I tried with Jack for a while, but until I found out that I can't even
run the supplied examples without any advanced stuff I retreated to
the simpler beanstalk-client. So I ended up with something like this:
require 'rubygems'
require 'blather/client'
require 'beanstalk-client'
setup '
acc...@gmail.com', 'password
DEFAULT_PORT = 11300
SERVER_IP = '127.0.0.1'
DEFAULT_PRIORITY = 1
TTR = 3
def get_queue(queue_name)
qonnection = Beanstalk::Pool.new(["#{SERVER_IP}:#{DEFAULT_PORT}"])
qonnection.watch(queue_name)
qonnection.use(queue_name)
qonnection.ignore('default')
puts 'Got connection to beanstalk queue: ' + queue_name.to_s
qonnection
end
outQ = get_queue(:outQ)
# Called after the connection has been connected.
handle :ready do
loop do # <--- killer loop!
job = outQ.reserve
puts
job.id
say job.ybody[:handle], job.ybody[:body]
job.delete
end
end
I can run this stuff, and it reserves and sends one stanza to my
receiving account (without the 'killer loop'). But, that's it, no
repeating the sending for more messages in the queue. Once I
integrated the crude killer loop, I get all the messaged correctly
reserved, consumed and deleted (and putted to the tty) but blather
doesn't even go online. This probably has something to do with you
thread magic in blather, I presume. Any ideas?
Thanks, Tom
P.S. I contacted DJ2 (the auther of Jack), we'll see what he says.