omf_ec 6.1.10 → 6.1.11

Sign up to get free protection for your applications and to get access to all the features.
Files changed (2) hide show
  1. data/lib/omf_ec/dsl.rb +12 -7
  2. metadata +5 -5
data/lib/omf_ec/dsl.rb CHANGED
@@ -211,13 +211,18 @@ module OmfEc
211
211
  end
212
212
 
213
213
  # Define an event callback
214
- def on_event(name, consume_event = true, &callback)
214
+ #
215
+ # @param [Symbol] name of the event
216
+ #
217
+ # @param [Hash] opts additional options
218
+ # @option opts [Boolean] :consume_event indicates if event callback will triggered ONLY once when condition met. Default true.
219
+ def on_event(name, opts = { consume_event: true }, &callback)
215
220
  unless (event = OmfEc.experiment.event(name))
216
221
  raise RuntimeError, "Event '#{name}' not defined"
217
222
  else
218
223
  event[:callbacks] ||= []
219
224
  event[:callbacks] << callback
220
- event[:consume_event] = consume_event
225
+ event[:consume_event] = opts[:consume_event]
221
226
  end
222
227
  end
223
228
 
@@ -332,11 +337,11 @@ module OmfEc
332
337
  # This requires that the EC was started with its JobService related
333
338
  # parameters set (e.g. js_url or job_url)
334
339
  # The EC contacts the JobService and:
335
- # 1 - request the creation of a Measurement Point corresponding the query
340
+ # 1 - request the creation of a Measurement Point corresponding the query
336
341
  # parameter of this function.
337
- # 2 - read the data generated by that query, and return it.
342
+ # 2 - read the data generated by that query, and return it.
338
343
  #
339
- # @param query a SQL query
344
+ # @param query a SQL query
340
345
  #
341
346
  def def_query(query)
342
347
  raise "No valid URL to connect to the Job Service!" if OmfEc.experiment.job_url.nil?
@@ -383,7 +388,7 @@ module OmfEc
383
388
  # experiment (e.g. app.measure('foo') in a addApplication block)
384
389
  #
385
390
  # @param ms_name the name of the existing measurement stream on which to run
386
- # this query
391
+ # this query
387
392
  #
388
393
  def ms(ms_name)
389
394
  db = Sequel.postgres
@@ -396,7 +401,7 @@ module OmfEc
396
401
  msb
397
402
  end
398
403
 
399
- # Query a Slice Service to get back the list of resources which were
404
+ # Query a Slice Service to get back the list of resources which were
400
405
  # previously provisioned for the slice within which this EC is operating.
401
406
  # Return either an empty array or an array of Hash (actually Hashie::Mash)
402
407
  # Require that the EC was provided an URL to a slice service (option
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: omf_ec
3
3
  version: !ruby/object:Gem::Version
4
- version: 6.1.10
4
+ version: 6.1.11
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2014-10-10 00:00:00.000000000 Z
12
+ date: 2014-10-14 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: minitest
@@ -98,7 +98,7 @@ dependencies:
98
98
  requirements:
99
99
  - - '='
100
100
  - !ruby/object:Gem::Version
101
- version: 6.1.10
101
+ version: 6.1.11
102
102
  type: :runtime
103
103
  prerelease: false
104
104
  version_requirements: !ruby/object:Gem::Requirement
@@ -106,7 +106,7 @@ dependencies:
106
106
  requirements:
107
107
  - - '='
108
108
  - !ruby/object:Gem::Version
109
- version: 6.1.10
109
+ version: 6.1.11
110
110
  - !ruby/object:Gem::Dependency
111
111
  name: sequel
112
112
  requirement: !ruby/object:Gem::Requirement
@@ -204,7 +204,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
204
204
  version: '0'
205
205
  segments:
206
206
  - 0
207
- hash: -2796515617465100587
207
+ hash: -2179348224371079724
208
208
  requirements: []
209
209
  rubyforge_project: omf_ec
210
210
  rubygems_version: 1.8.23