sadie 0.1.10 → 0.1.11

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 1dfcdf40230ae04f9b2f48e4cb73aafd71fc8ac7
4
- data.tar.gz: 7f6aaca2f1f58be905c70bb428d695c726f1b972
3
+ metadata.gz: 28c3bbcce5f0538173050256b4f03df4d247826c
4
+ data.tar.gz: 358530ee9c81a76cfb79f119d9ac676aa906e506
5
5
  SHA512:
6
- metadata.gz: e9668d2c48564497cabfa531bec49ae7178dd764fc897a1f24513c92c85b781fe3d18027e28f4007ecbd92e5eff7059be7c5d96470823a78bc05969c27c2191b
7
- data.tar.gz: bf5835fdbcb385b8b3b6c7675908a0fcb1e78d91d921d2e0519ea27d6baef5e74a26ae172118d92e0309960fc8958496bf349e3f6e358b297ff03ddd6fbf88b3
6
+ metadata.gz: d72cfcd93b844527dba9f122ff7ec0c1934a79f047f59bcb5c8dbb2bf620c79b0784943fd94b3d2a59f1113381fd7a5c30b6c97fd860c57965daf07e2c50582f
7
+ data.tar.gz: 7582971beaf635ef21c4642e079b92ebf1742a800b105c774450b26a96199f92075f5bc428ff6df74dad9d17f1fc562927464d4e3fe3696d4e2f8533b3ddc337
data/CHANGELOG CHANGED
@@ -28,4 +28,5 @@
28
28
  [0.1.01] ** ground-up rewrite, ignore everything before this line if you're not a historian **
29
29
  [0.1.8] new version now at capability pairing with old version.
30
30
  [0.1.9] added metadata for keys, abstracted expiry and refresh data structs into timestamp queues, abstracted various mutexes in session into lock manager object in preparation for distributed behavior
31
- [0.1.10] added important lock to ensure that two threads (refresh and fetch, in this case, but will be more important in distributed case) cannot attempt to prime for the same key at the same time
31
+ [0.1.10] added important lock to ensure that two threads (refresh and fetch, in this case, but will be more important in distributed case) cannot attempt to prime for the same key at the same time
32
+ [0.1.11] threading bugfixes
data/README CHANGED
@@ -86,7 +86,9 @@ So it'd be great for grabbing a list of all facebook users who've ever mentioned
86
86
 
87
87
  Similarly, it'd be a wonderful tool for performing a statistical analysis on the game of baseball based on data from every baseball game ever played, but it's not well set up for you to ask it about a particular game (unless the game were of such interest that you took the time to write primers that were associated with that particular game).
88
88
 
89
- Of course, it is, at it's core, a key/value hash and, as such, you could use it to do such things as well as you could any other. It is the primers that are limited, not the storage mechanism.
89
+ Of course, it is, at it's core, a key/value hash and, as such, you could use it to do such things as well as you could any other. It is the primers that are limited, not the storage mechanism, so it'd be fine to build a web application that would depend upon Sadie to keep an updated version of all your chattering facebook friends and/or statistics about all the baseball games ever played and the same web app could easily mine this data for interesting things and use Sadie to cache the results of said mining for future use. The important point here is that the primers exist to do the heavy lifting of data aggregation and transformation into usable forms and, beyond that, Sadie is a key/value store like many others.
90
+
91
+
90
92
 
91
93
  ==Contribute
92
94
  Do it! The github url for Sadie is at: [https://github.com/FredAtLandMetrics/sadie]
@@ -1,3 +1,3 @@
1
1
  class Sadie
2
- VERSION = "0.1.10"
2
+ VERSION = "0.1.11"
3
3
  end
@@ -267,9 +267,15 @@ class SadieSession
267
267
  end
268
268
 
269
269
  def _refresh( key )
270
- p = Primer.new( :session => self )
271
- p.decorate( @registered_key[ key ] )
272
- _manage_refresh( key, p.refresh_rate )
270
+ @primer_lock = @lockmgr.create( :systype => :session,
271
+ :locktype => :primer,
272
+ :key => key )
273
+ p = nil
274
+ @lockmgr.critical_section_try( @primer_lock ) do
275
+ p = _get_primed_primer( key )
276
+ end
277
+
278
+ _manage_refresh( key, p.refresh_rate ) unless p.nil?
273
279
  end
274
280
 
275
281
  def _current_time
@@ -0,0 +1,7 @@
1
+ prime ["wait.primary"] do
2
+ refresh 1
3
+ assign do
4
+ secval = session.get("wait.secondary")
5
+ set "primary#{secval}"
6
+ end
7
+ end
@@ -0,0 +1,16 @@
1
+ prime ["wait.secondary"] do
2
+ refresh 1
3
+ before :each do
4
+ $counter ||= 0
5
+ $max ||= 0
6
+ $counter += 1
7
+ $max = $counter if $counter > $max
8
+ end
9
+ after :each do
10
+ $counter -= 1
11
+ end
12
+ assign do
13
+ sleep 1
14
+ set "secondary"
15
+ end
16
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sadie
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.10
4
+ version: 0.1.11
5
5
  platform: ruby
6
6
  authors:
7
7
  - Fred McDavid
@@ -133,6 +133,8 @@ files:
133
133
  - test/v2/test_installation/primers/minimal.rb
134
134
  - test/v2/test_installation/primers/minimal_filestormech.rb
135
135
  - test/v2/test_installation/primers/onelevel/twolevel/test_subdir.rb
136
+ - test/v2/test_installation/primers/primer_wait_primary.rb
137
+ - test/v2/test_installation/primers/primer_wait_secondary.rb
136
138
  - test/v2/test_installation/primers/test_after_each.rb
137
139
  - test/v2/test_installation/primers/test_after_key.rb
138
140
  - test/v2/test_installation/primers/test_before_each.rb