Module: Hydna
- Defined in:
- lib/hydna.rb
Constant Summary collapse
- DEFAULT_CHANNEL =
"/"
- MAX_PAYLOAD_SIZE =
0xFFFA
- MAX_TOKEN_SIZE =
MAX_PAYLOAD_SIZE
Class Method Summary collapse
- .emit(domain, data, ctoken = nil, agent = 'hydna-ruby-push') ⇒ Object
- .push(domain, data, prio = 0, ctoken = nil, agent = 'hydna-ruby-push') ⇒ Object
Class Method Details
.emit(domain, data, ctoken = nil, agent = 'hydna-ruby-push') ⇒ Object
11 12 13 14 15 16 17 18 19 20 21 |
# File 'lib/hydna.rb', line 11 def self.emit(domain, data, ctoken=nil, agent='hydna-ruby-push') headers = { 'Content-Type' => 'text/plain', 'User-Agent' => agent, 'X-Emit' => 'yes' } send(domain, headers, data) end |
.push(domain, data, prio = 0, ctoken = nil, agent = 'hydna-ruby-push') ⇒ Object
23 24 25 26 27 28 29 30 31 32 33 34 35 36 |
# File 'lib/hydna.rb', line 23 def self.push(domain, data, prio=0, ctoken=nil, agent='hydna-ruby-push') headers = { 'Content-Type' => 'text/plain', 'User-Agent' => agent } prio = clean_prio(prio) headers['X-Priority'] = prio.to_s() send(domain, headers, data) end |