Class: NchanTools::Subscriber::IntervalPollClient

Inherits:
LongPollClient show all
Defined in:
lib/nchan_tools/pubsub.rb

Instance Attribute Summary

Attributes inherited from LongPollClient

#timeout

Attributes inherited from Client

#concurrency

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from LongPollClient

#close, #error, #initialize, #listen, #new_bundle, #run, #setup_bundle, #stop

Methods inherited from Client

#error, #handle_bundle_error, inherited, #initialize, lookup, #poke, #provides_msgid?, #run, #stop, unique_aliases

Constructor Details

This class inherits a constructor from NchanTools::Subscriber::LongPollClient

Class Method Details

.aliasesObject



1135
1136
1137
# File 'lib/nchan_tools/pubsub.rb', line 1135

def self.aliases
  [:intervalpoll, :http, :interval, :poll]
end

Instance Method Details

#request_code_ok(code, bundle) ⇒ Object



1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
# File 'lib/nchan_tools/pubsub.rb', line 1139

def request_code_ok(code, bundle)
  if code == 304
    if @subscriber.on_failure(error(code, "", bundle), true) == false
      @subscriber.finished+=1
      close bundle
    else
      Celluloid.sleep(@retry_delay || 1)
      bundle.send_GET
      false
    end
  else
    super
  end
end