Module: DEVp2p::Control

Included in:
BaseProtocol, BaseService
Defined in:
lib/devp2p/control.rb

Instance Method Summary collapse

Instance Method Details

#initialize_controlObject



4
5
6
7
# File 'lib/devp2p/control.rb', line 4

def initialize_control
  @stopped = false
  @killed = false
end

#killed?Boolean

Returns:

  • (Boolean)


27
28
29
# File 'lib/devp2p/control.rb', line 27

def killed?
  @killed
end

#runObject



9
10
11
# File 'lib/devp2p/control.rb', line 9

def run
  _run
end

#startObject



13
14
15
16
# File 'lib/devp2p/control.rb', line 13

def start
  @stopped = false
  async.run unless killed?
end

#stopObject



18
19
20
21
# File 'lib/devp2p/control.rb', line 18

def stop
  @stopped = true
  @killed = true
end

#stopped?Boolean

Returns:

  • (Boolean)


23
24
25
# File 'lib/devp2p/control.rb', line 23

def stopped?
  @stopped
end