0

I'm trying to start beanstalk server, and made 1 job to test it, but instead i got nothing. Here is my code:

require 'stalker'
include Stalker


job 'test.job' do
  somefile = File.new("somefile")

end

Im using stalker gem to connect ruby and beanstalkd. Any ideas what am i doing wrong?

Avdept
  • 2,261
  • 2
  • 26
  • 48

1 Answers1

1

Unless you open the file and write something into it, or something else, it's quite difficult to observe the job doing anything. Log something into STDOUT, write something into the file or anything else, and then you will be able to see the job executing...

rewritten
  • 16,280
  • 2
  • 47
  • 50
  • i've tried to write some text into file, but that didnt work aswell. More then as far as i see there should be some info written afte beanstalkd server – Avdept Oct 30 '12 at 15:44
  • To write things into files, you should use `File.open(filename) {|f| ... }` and use `f.write` into the block. In general, to make a job, thry to use existing code that you already know to work. As an example, write a rake task doing the same, put the executable code into a module or class, and then let the rake task and the BS job execute exactly the same. – rewritten Oct 30 '12 at 15:48