Class: Reth::JSONRPC::Server

Inherits:
Object
  • Object
show all
Includes:
Concurrent::Async
Defined in:
lib/reth/jsonrpc/server.rb

Instance Method Summary collapse

Constructor Details

#initialize(app, host, port) ⇒ Server

Returns a new instance of Server.



7
8
9
10
11
12
13
# File 'lib/reth/jsonrpc/server.rb', line 7

def initialize(app, host, port)
  super()

  @app  = app
  @host = host
  @port = port
end

Instance Method Details

#startObject



15
16
17
18
19
20
# File 'lib/reth/jsonrpc/server.rb', line 15

def start
  Rack::Handler::WEBrick.run App.new(@app), Host: @host, Port: @port
rescue
  puts $!
  puts $!.backtrace[0,10].join("\n")
end