Request-reply worker in Ruby

#!/usr/bin/env ruby

# author: Oleg Sidorov <4pcbr> moc.liamg|rbcp4i#moc.liamg|rbcp4i
# this code is licenced under the MIT/X11 licence.

require 'rubygems'
require 'ffi-rzmq'

context = ZMQ::Context.new
socket = context.socket(ZMQ::REP)
socket.connect('tcp://localhost:5560')

loop do
socket.recv_string(message = '')
puts "Received request: #{message}"
socket.send_string('World')
end