Module: QQQ::API
- Defined in:
- lib/qqq/api.rb
Class Method Summary collapse
-
.publish(event) ⇒ Object
desc :send, “Sends message to a remote server” def send QQQ.subscribe do |event| puts “Remotely publishing: #eventevent.message” API.publish(event) end end.
Class Method Details
.publish(event) ⇒ Object
14 15 16 17 18 |
# File 'lib/qqq/api.rb', line 14 def self.publish(event) conn = Faraday.new(:url => "http://localhost:3600") resp = conn.post '/events', { :event => event.as_json } puts resp.status, resp.body end |