concord-ruby 0.1.3 → 0.2.0
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/concord.rb +18 -15
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 08571768242c5bc9df4c4bb4a8b244fb4eccdae8
|
4
|
+
data.tar.gz: 3f7e011a7820b7a3f7ba3eadcf56fae50c0cd457
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f6d84315b854e079052842633510d6038bee3a06ba1953921fb63a0cc90fb9a7da437511587aa46180542cd34d26e3416343c5097e26c03258d0b887b0cc28e8
|
7
|
+
data.tar.gz: 21565c0841687b55f0be764c9e6f76c2781f99e89cdd4fd9fdab4e39cf12bcaa36f8cfc9b897ab6086f1ff6b9f73a74c7060a0ca2a5ad6e66f8d38672e912a92
|
data/lib/concord.rb
CHANGED
@@ -113,10 +113,15 @@ module Concord
|
|
113
113
|
transport = ::Thrift::ServerSocket.new(listen_host, Integer(listen_port))
|
114
114
|
transport_factory = ::Thrift::FramedTransportFactory.new
|
115
115
|
protocol_factory = ::Thrift::BinaryProtocolAcceleratedFactory.new
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
116
|
+
# The reason the client computations MUST use a simple blocking server
|
117
|
+
# is that we have process_timer and process_record both which exec as
|
118
|
+
# a callback in the work thread pool which means that you might get
|
119
|
+
# 2 callbacks whichs makes the code multi threaded - we guarantee single
|
120
|
+
# thread for each callback
|
121
|
+
server = ::Thrift::SimpleServer.new(processor,
|
122
|
+
transport,
|
123
|
+
transport_factory,
|
124
|
+
protocol_factory)
|
120
125
|
# Register with localhost proxy. Note that this method is `oneway'
|
121
126
|
# which means after final TCP 'ack' it finishes.
|
122
127
|
handler.register_with_scheduler
|
@@ -210,23 +215,21 @@ module Concord
|
|
210
215
|
end
|
211
216
|
|
212
217
|
def enrich_metadata(metadata)
|
213
|
-
enrich_stream
|
214
|
-
|
215
|
-
grouping = nil
|
218
|
+
def enrich_stream(stream)
|
219
|
+
sm = ::Concord::Thrift::StreamMetadata.new
|
216
220
|
if stream.is_a?(Array)
|
217
|
-
name
|
221
|
+
sm.name = stream.first
|
222
|
+
sm.grouping = stream.last
|
218
223
|
else
|
219
|
-
name = stream
|
224
|
+
sm.name = stream
|
220
225
|
end
|
221
|
-
sm = ::Concord::Thrift::StreamMetadata.new
|
222
|
-
sm.name = name
|
223
|
-
sm.grouping = grouping unless grouping.nil?
|
224
226
|
sm
|
225
|
-
|
227
|
+
end
|
228
|
+
|
226
229
|
cm = ::Concord::Thrift::ComputationMetadata.new
|
227
230
|
cm.name = metadata.name
|
228
|
-
cm.istreams = metadata.istreams.map { |x| enrich_stream
|
229
|
-
cm.ostreams = metadata.ostreams.map { |x| enrich_stream
|
231
|
+
cm.istreams = metadata.istreams.map { |x| enrich_stream(x) }
|
232
|
+
cm.ostreams = metadata.ostreams.map { |x| enrich_stream(x) }
|
230
233
|
cm.proxyEndpoint = ::Concord::Thrift::Endpoint.new
|
231
234
|
cm.proxyEndpoint.ip = proxy_host
|
232
235
|
cm.proxyEndpoint.port = proxy_port
|