radar-app 0.0.5 → 0.0.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/radar-app.rb +1 -19
- data/lib/radar/app.rb +31 -2
- data/lib/{analyzer_controller.rb → radar/app/analyzer_controller.rb} +0 -0
- data/lib/radar/app/core_ext.rb +1 -0
- data/lib/radar/app/core_ext/date.rb +1 -1
- data/lib/radar/app/server.rb +17 -0
- data/lib/radar/app/version.rb +1 -1
- data/radar-app.gemspec +1 -1
- metadata +19 -6
- data/lib/radar/app/fund_service_factory.rb +0 -9
- data/lib/radar/app/index_service_factory.rb +0 -9
- data/lib/radar/app/security_service_factory.rb +0 -9
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cc65b453f94ea8cba1db7ff6a8b51f2476bb12ec
|
4
|
+
data.tar.gz: dd72925feb92dec18ba51b0e16e4fe5fff524db2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 57bb91a1904a07e57ccff712361e3891958daa04a7f5fb30efa528b58a8b8c891f0cb40458d87e93edf9c364ffee67b02d79cb83b3953731b653e644e67e71ca
|
7
|
+
data.tar.gz: 3a875a35f93afc507b5b994ceacaf4de1bead59ccda141931d02cf8574320f762d7ae039c8ff44f75a21fc9549cdd89ee52148321202496f7b16b93d488bd196
|
data/lib/radar-app.rb
CHANGED
@@ -1,19 +1 @@
|
|
1
|
-
require
|
2
|
-
require 'analyzer_controller'
|
3
|
-
require 'radar-api'
|
4
|
-
|
5
|
-
module Radar
|
6
|
-
module App
|
7
|
-
class Server
|
8
|
-
def self.start
|
9
|
-
handler = Radar::App::AnalyzerController.new
|
10
|
-
processor = Radar::API::AnalyzerController::Processor.new(handler)
|
11
|
-
transport = Thrift::ServerSocket.new(5000)
|
12
|
-
transportFactory = Thrift::BufferedTransportFactory.new
|
13
|
-
server = Thrift::ThreadedServer.new(processor, transport)
|
14
|
-
puts "Starting server..."
|
15
|
-
server.serve()
|
16
|
-
end
|
17
|
-
end
|
18
|
-
end
|
19
|
-
end
|
1
|
+
require 'radar/app'
|
data/lib/radar/app.rb
CHANGED
@@ -1,7 +1,36 @@
|
|
1
|
-
require
|
1
|
+
require 'radar/app/version'
|
2
|
+
require 'radar/app/core_ext'
|
3
|
+
require 'radar/app/analyzer_controller'
|
4
|
+
|
5
|
+
require 'connection_pool'
|
6
|
+
require 'radar-api'
|
2
7
|
|
3
8
|
module Radar
|
4
9
|
module App
|
5
|
-
|
10
|
+
def self.security_service
|
11
|
+
@security_service ||= connection_pool(Radar::API::Security::Client, 9790)
|
12
|
+
end
|
13
|
+
|
14
|
+
def self.index_service
|
15
|
+
@index_service ||= connection_pool(Radar::API::FundService::Client, 9791)
|
16
|
+
end
|
17
|
+
|
18
|
+
def self.fund_service
|
19
|
+
@fund_service ||= connection_pool(Radar::API::IndexService::Client, 9792)
|
20
|
+
end
|
21
|
+
|
22
|
+
protected
|
23
|
+
|
24
|
+
def self.connection_pool(client_class, port)
|
25
|
+
ConnectionPool.new { connection(client_class, port) }
|
26
|
+
end
|
27
|
+
|
28
|
+
def self.connection(client_class, port)
|
29
|
+
host = ENV['DATA_SERVER_HOST'] || '127.0.0.1'
|
30
|
+
transport = Thrift::BufferedTransport.new(Thrift::Socket.new(host, port))
|
31
|
+
protocol = Thrift::BinaryProtocol.new(transport)
|
32
|
+
transport.open
|
33
|
+
client_class.new(protocol)
|
34
|
+
end
|
6
35
|
end
|
7
36
|
end
|
File without changes
|
@@ -0,0 +1 @@
|
|
1
|
+
require 'radar/app/core_ext/date'
|
@@ -0,0 +1,17 @@
|
|
1
|
+
require 'radar-api'
|
2
|
+
|
3
|
+
module Radar
|
4
|
+
module App
|
5
|
+
class Server
|
6
|
+
def self.start
|
7
|
+
handler = Radar::App::AnalyzerController.new
|
8
|
+
processor = Radar::API::AnalyzerController::Processor.new(handler)
|
9
|
+
transport = Thrift::ServerSocket.new(5000)
|
10
|
+
transportFactory = Thrift::BufferedTransportFactory.new
|
11
|
+
server = Thrift::ThreadedServer.new(processor, transport)
|
12
|
+
puts "Starting server..."
|
13
|
+
server.serve()
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
data/lib/radar/app/version.rb
CHANGED
data/radar-app.gemspec
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: radar-app
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Leonardo Mendonca
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-04-
|
11
|
+
date: 2014-04-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -80,6 +80,20 @@ dependencies:
|
|
80
80
|
- - '='
|
81
81
|
- !ruby/object:Gem::Version
|
82
82
|
version: 1.6.2
|
83
|
+
- !ruby/object:Gem::Dependency
|
84
|
+
name: connection_pool
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - "~>"
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: '2.0'
|
90
|
+
type: :runtime
|
91
|
+
prerelease: false
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - "~>"
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: '2.0'
|
83
97
|
description: generates and run a radar-app.
|
84
98
|
email:
|
85
99
|
- leonardo.mendonca@investtools.com.br
|
@@ -95,13 +109,12 @@ files:
|
|
95
109
|
- README.md
|
96
110
|
- Rakefile
|
97
111
|
- bin/radar-app
|
98
|
-
- lib/analyzer_controller.rb
|
99
112
|
- lib/radar-app.rb
|
100
113
|
- lib/radar/app.rb
|
114
|
+
- lib/radar/app/analyzer_controller.rb
|
115
|
+
- lib/radar/app/core_ext.rb
|
101
116
|
- lib/radar/app/core_ext/date.rb
|
102
|
-
- lib/radar/app/
|
103
|
-
- lib/radar/app/index_service_factory.rb
|
104
|
-
- lib/radar/app/security_service_factory.rb
|
117
|
+
- lib/radar/app/server.rb
|
105
118
|
- lib/radar/app/version.rb
|
106
119
|
- radar-app.gemspec
|
107
120
|
- templates/Gemfile
|
@@ -1,9 +0,0 @@
|
|
1
|
-
class Radar::App::FundServiceFactory
|
2
|
-
def self.create
|
3
|
-
host = ENV['RADAR_HOST'] || '127.0.0.1'
|
4
|
-
transport = Thrift::BufferedTransport.new(Thrift::Socket.new(host, 9791))
|
5
|
-
protocol = Thrift::BinaryProtocol.new(transport)
|
6
|
-
transport.open
|
7
|
-
Radar::API::FundService::Client.new(protocol)
|
8
|
-
end
|
9
|
-
end
|
@@ -1,9 +0,0 @@
|
|
1
|
-
class Radar::App::IndexServiceFactory
|
2
|
-
def self.create
|
3
|
-
host = ENV['RADAR_HOST'] || '127.0.0.1'
|
4
|
-
transport = Thrift::BufferedTransport.new(Thrift::Socket.new(host, 9792))
|
5
|
-
protocol = Thrift::BinaryProtocol.new(transport)
|
6
|
-
transport.open
|
7
|
-
Radar::API::IndexService::Client.new(protocol)
|
8
|
-
end
|
9
|
-
end
|
@@ -1,9 +0,0 @@
|
|
1
|
-
class Radar::App::SecurityServiceFactory
|
2
|
-
def self.create
|
3
|
-
host = ENV['RADAR_HOST'] || '127.0.0.1'
|
4
|
-
transport = Thrift::BufferedTransport.new(Thrift::Socket.new(host, 9790))
|
5
|
-
protocol = Thrift::BinaryProtocol.new(transport)
|
6
|
-
transport.open
|
7
|
-
Radar::API::SecurityService::Client.new(protocol)
|
8
|
-
end
|
9
|
-
end
|