Class: RailsGrpc::CLI
- Inherits:
-
Object
- Object
- RailsGrpc::CLI
- Includes:
- Singleton
- Defined in:
- lib/rails_grpc/cli.rb
Constant Summary collapse
- WORKER_LAUNCH_RETRY_LIMIT =
3
- RAILS_LAUNCH_WAIT_TIME =
FIXME
10
Instance Attribute Summary collapse
-
#mutex ⇒ Object
Returns the value of attribute mutex.
-
#server ⇒ Object
Returns the value of attribute server.
-
#worker_pid ⇒ Object
Returns the value of attribute worker_pid.
Instance Method Summary collapse
-
#initialize ⇒ CLI
constructor
A new instance of CLI.
- #parse ⇒ Object
- #run ⇒ Object
Constructor Details
#initialize ⇒ CLI
Returns a new instance of CLI.
13 14 15 16 |
# File 'lib/rails_grpc/cli.rb', line 13 def initialize @mutex = Mutex.new set_environment end |
Instance Attribute Details
#mutex ⇒ Object
Returns the value of attribute mutex.
11 12 13 |
# File 'lib/rails_grpc/cli.rb', line 11 def mutex @mutex end |
#server ⇒ Object
Returns the value of attribute server.
11 12 13 |
# File 'lib/rails_grpc/cli.rb', line 11 def server @server end |
#worker_pid ⇒ Object
Returns the value of attribute worker_pid.
11 12 13 |
# File 'lib/rails_grpc/cli.rb', line 11 def worker_pid @worker_pid end |
Instance Method Details
#parse ⇒ Object
18 19 |
# File 'lib/rails_grpc/cli.rb', line 18 def parse end |
#run ⇒ Object
21 22 23 24 25 26 27 28 29 30 31 |
# File 'lib/rails_grpc/cli.rb', line 21 def run @worker_pid = Process.fork if @worker_pid puts "Start GRPC master (pid: #{$$})" set_master_trap Process.waitall else boot_grpc_server end end |