module Qwaiter
  module Broadcaster
    class Faye
      def broadcast(message)
        @uri ||= URI.parse(Qwaiter.event_host)
        Net::HTTP.post_form(@uri, message: message.merge(ext: {auth_token: '6be65f9b5e7d21b8ca8de4ccfad5ba24cf40d440b370af79'}).to_json)
      rescue => e
        Rails.logger.error("[FAYE] #{e.message}")
      end
    end
  end
end
