Method: Cod::Beanstalk::Channel#get

Defined in:
lib/cod/beanstalk/channel.rb

#getObject

Reads a job from the tube and decodes it as a message.

Returns:

  • (Object)


61
62
63
64
65
66
67
68
# File 'lib/cod/beanstalk/channel.rb', line 61

def get
  id, msg = bs_reserve
  
  # We delete the job immediately, since #get should be definitive.
  bs_delete(id)

  deserialize(msg)
end