Class: Bones::RPC::Future

Inherits:
Celluloid::Future
  • Object
show all
Defined in:
lib/bones/rpc/future.rb

Instance Method Summary collapse

Constructor Details

#initialize(*args, &block) ⇒ Future

Returns a new instance of Future.


6
7
8
9
# File 'lib/bones/rpc/future.rb', line 6

def initialize(*args, &block)
  @start = Time.now
  super
end

Instance Method Details

#runtimeObject


16
17
18
19
20
21
22
# File 'lib/bones/rpc/future.rb', line 16

def runtime
  if @stop
    @stop - @start
  else
    Time.now - @start
  end
end

#signal(*args, &block) ⇒ Object


11
12
13
14
# File 'lib/bones/rpc/future.rb', line 11

def signal(*args, &block)
  @stop = Time.now
  super
end