Class: Radiator::SSC::BaseSteemSmartContractRPC
- Inherits:
-
Object
- Object
- Radiator::SSC::BaseSteemSmartContractRPC
- Defined in:
- lib/radiator/ssc/base_steem_smart_contract_rpc.rb
Direct Known Subclasses
Constant Summary collapse
- POST_HEADERS =
{ 'Content-Type' => 'application/json', 'User-Agent' => Radiator::AGENT_ID }
- MAX_BACKOFF =
60.0
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ BaseSteemSmartContractRPC
constructor
A new instance of BaseSteemSmartContractRPC.
-
#shutdown ⇒ Object
Stops the persistant http connections.
Constructor Details
#initialize(options = {}) ⇒ BaseSteemSmartContractRPC
Returns a new instance of BaseSteemSmartContractRPC.
12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 |
# File 'lib/radiator/ssc/base_steem_smart_contract_rpc.rb', line 12 def initialize( = {}) @root_url = [:root_url] || 'https://api.steem-engine.net/rpc' @self_hashie_logger = false @hashie_logger = if [:hashie_logger].nil? @self_hashie_logger = true Logger.new(nil) else [:hashie_logger] end unless @hashie_logger.respond_to? :warn @hashie_logger = Logger.new(@hashie_logger) end @reuse_ssl_sessions = if .keys.include? :reuse_ssl_sessions [:reuse_ssl_sessions] else true end @persist = if [:persist].nil? true else [:persist] end if defined? Net::HTTP::Persistent::DEFAULT_POOL_SIZE @pool_size = [:pool_size] || Net::HTTP::Persistent::DEFAULT_POOL_SIZE end Hashie.logger = @hashie_logger @uri = nil @http_id = nil @http = nil @max_requests = [:max_requests] || 30 end |
Instance Method Details
#shutdown ⇒ Object
Stops the persistant http connections.
52 53 54 55 56 |
# File 'lib/radiator/ssc/base_steem_smart_contract_rpc.rb', line 52 def shutdown @uri = nil @http_id = nil @http = nil end |