Module: Postbox

Extended by:
Postbox
Included in:
Postbox
Defined in:
lib/postbox.rb,
lib/postbox/http.rb,
lib/postbox/stack.rb,
lib/postbox/worker.rb

Defined Under Namespace

Modules: HTTP, Stack, Worker

Constant Summary collapse

IS_IRB =
$0 == 'irb'

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#attempt_countObject



15
16
17
# File 'lib/postbox.rb', line 15

def attempt_count
  @attempt_count ||= 10
end

#attempt_delayObject



19
20
21
# File 'lib/postbox.rb', line 19

def attempt_delay
  @attempt_delay ||= 6
end

Instance Method Details

#post(url, params = {}, &callback) ⇒ Object



23
24
25
26
27
# File 'lib/postbox.rb', line 23

def post(url, params = {}, &callback)
  item = Stack.push(url, params, &callback) 
  Postbox::Worker.worker_thread.join if IS_IRB
  return item
end