concord-ruby 0.0.4 → 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/concord.rb +28 -4
- 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: d469842cf02cf7b6644f308e5fd1509a635961c4
|
4
|
+
data.tar.gz: 9216221387ad151c83ef6745be6df3eb8a95b5b5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 40f5c72c5e5b5d7663907f44fefefef11de0ca85b89ddf75fb34e9e101fe1bd06dd0285324832cf7c3a9a3f310118a42576849424e7fd88a8b03bb317edd625d
|
7
|
+
data.tar.gz: 7d368972217c1be533aa19d1f6be3780fc0ddbb61a0741ede2a57a782d1a0229eeeb852b5a38a837c2451c6adf8f0bf463c0d10455b48a2a7370cf010b3caa64
|
data/lib/concord.rb
CHANGED
@@ -119,7 +119,9 @@ module Concord
|
|
119
119
|
# @param record [Concord::Thrift::Record] The record to process
|
120
120
|
def boltProcessRecord(record)
|
121
121
|
ctx = ComputationContext.new(self)
|
122
|
-
|
122
|
+
log_failure do
|
123
|
+
handler.process_record(ctx, record)
|
124
|
+
end
|
123
125
|
ctx.transaction
|
124
126
|
end
|
125
127
|
|
@@ -129,7 +131,9 @@ module Concord
|
|
129
131
|
# @param time [FixNum] Time this callback was scheduled to trigger.
|
130
132
|
def boltProcessTimer(key, time)
|
131
133
|
ctx = ComputationContext.new(self)
|
132
|
-
|
134
|
+
log_failure do
|
135
|
+
handler.process_timer(ctx, key, time)
|
136
|
+
end
|
133
137
|
ctx.transaction
|
134
138
|
end
|
135
139
|
|
@@ -138,13 +142,18 @@ module Concord
|
|
138
142
|
# which is returned to the proxy upon completion.
|
139
143
|
def init
|
140
144
|
ctx = ComputationContext.new(self)
|
141
|
-
|
145
|
+
log_failure do
|
146
|
+
handler.init(ctx)
|
147
|
+
end
|
142
148
|
ctx.transaction
|
143
149
|
end
|
144
150
|
|
145
151
|
# @return [Concord::Thrift::ComputationMetadata] The user-defined computation metadata.
|
146
152
|
def boltMetadata
|
147
|
-
metadata =
|
153
|
+
metadata = nil
|
154
|
+
log_failure do
|
155
|
+
metadata = handler.metadata
|
156
|
+
end
|
148
157
|
enrich_metadata(metadata)
|
149
158
|
end
|
150
159
|
|
@@ -164,6 +173,21 @@ module Concord
|
|
164
173
|
|
165
174
|
private
|
166
175
|
|
176
|
+
def log(msg, handle: $stderr)
|
177
|
+
handle.puts msg
|
178
|
+
handle.flush
|
179
|
+
end
|
180
|
+
|
181
|
+
def log_failure(&block)
|
182
|
+
begin
|
183
|
+
block.call
|
184
|
+
rescue => e
|
185
|
+
log e.message
|
186
|
+
log e.backtrace.join("\n")
|
187
|
+
raise e
|
188
|
+
end
|
189
|
+
end
|
190
|
+
|
167
191
|
def proxy
|
168
192
|
if @proxy.nil? || !@proxy_socket.open?
|
169
193
|
@proxy_socket = ::Thrift::Socket.new(proxy_host, proxy_port)
|