Class: Rapns::Daemon::DeliveryHandler
- Inherits:
-
Object
- Object
- Rapns::Daemon::DeliveryHandler
show all
- Includes:
- Reflectable
- Defined in:
- lib/rapns/daemon/delivery_handler.rb
Instance Attribute Summary collapse
Instance Method Summary
collapse
#reflect
Instance Attribute Details
#queue ⇒ Object
Returns the value of attribute queue.
6
7
8
|
# File 'lib/rapns/daemon/delivery_handler.rb', line 6
def queue
@queue
end
|
Instance Method Details
#start ⇒ Object
8
9
10
11
12
13
14
15
|
# File 'lib/rapns/daemon/delivery_handler.rb', line 8
def start
@thread = Thread.new do
loop do
handle_next_notification
break if @stop
end
end
end
|
#stop ⇒ Object
17
18
19
20
21
22
23
24
|
# File 'lib/rapns/daemon/delivery_handler.rb', line 17
def stop
@stop = true
if @thread
queue.wakeup(@thread)
@thread.join
end
stopped
end
|