def receive(packet)
Nanite::Log.debug("RECV #{packet.to_s}")
case packet
when Advertise
advertise_services
when Request, Push
if @security && !@security.authorize(packet)
Nanite::Log.warn("RECV NOT AUTHORIZED #{packet.to_s}")
if packet.kind_of?(Request)
r = Result.new(packet.token, packet.reply_to, @deny_token, identity)
amq.queue(packet.reply_to, :no_declare => options[:secure]).publish(serializer.dump(r))
end
else
dispatcher.dispatch(packet)
end
when Result
@mapper_proxy.handle_result(packet)
when IntermediateMessage
@mapper_proxy.handle_intermediate_result(packet)
end
end