tupelo 0.4 → 0.5

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.
@@ -1,31 +1,33 @@
1
1
  require 'tupelo/app'
2
+ require 'time-fuzz'
2
3
 
3
4
  N = 100
4
5
 
6
+ client_class = Tupelo::TimeFuzz::Client
7
+ Tupelo::TimeFuzz.sleep_max = 0.01
8
+
5
9
  Tupelo.application do |app|
6
- app.child do |client|
10
+ app.child(client_class) do |client|
7
11
  N.times do
8
12
  client.transaction do |t|
9
13
  x, y = t.take [nil, nil]
10
- sleep rand/100
11
14
  t.write [x+1, y]
12
15
  end
13
16
  end
14
17
  client.write ["done"]
15
18
  end
16
19
 
17
- app.child do |client|
20
+ app.child(client_class) do |client|
18
21
  N.times do
19
22
  client.transaction do |t|
20
23
  x, y = t.take [nil, nil]
21
- sleep rand/100
22
24
  t.write [x, y+1]
23
25
  end
24
26
  end
25
27
  client.write ["done"]
26
28
  end
27
29
 
28
- app.local do |client|
30
+ app.local(client_class) do |client|
29
31
  client.write [0, 0]
30
32
 
31
33
  2.times do
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tupelo
3
3
  version: !ruby/object:Gem::Version
4
- version: '0.4'
4
+ version: '0.5'
5
5
  platform: ruby
6
6
  authors:
7
7
  - Joel VanderWerf
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-07-24 00:00:00.000000000 Z
11
+ date: 2013-07-31 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: atdo
@@ -79,6 +79,8 @@ files:
79
79
  - README.md
80
80
  - COPYING
81
81
  - Rakefile
82
+ - lib/tupelo/app/irb-shell.rb
83
+ - lib/tupelo/app/trace.rb
82
84
  - lib/tupelo/client.rb
83
85
  - lib/tupelo/app.rb
84
86
  - lib/tupelo/archiver.rb
@@ -87,9 +89,9 @@ files:
87
89
  - lib/tupelo/client/tuplespace.rb
88
90
  - lib/tupelo/client/transaction.rb
89
91
  - lib/tupelo/client/reader.rb
90
- - lib/tupelo/irb-shell.rb
91
92
  - lib/tupelo/archiver/worker.rb
92
93
  - lib/tupelo/archiver/tuplespace.rb
94
+ - lib/tupelo/util/boolean.rb
93
95
  - lib/tupelo/version.rb
94
96
  - bench/pipeline.rb
95
97
  - bugs/write-read.rb
@@ -115,10 +117,13 @@ files:
115
117
  - example/transaction-logic.rb
116
118
  - example/map-reduce.rb
117
119
  - example/balance-xfer.rb
118
- - example/broker-optimistic-async.rb
120
+ - example/add-dsl.rb
119
121
  - example/lock-mgr.rb
120
122
  - example/broker-locking.rb
123
+ - example/dphil-optimistic.rb
121
124
  - example/fail-and-retry.rb
125
+ - example/dphil-optimistic-v2.rb
126
+ - example/broker-optimistic-v2.rb
122
127
  - example/optimist.rb
123
128
  - example/balance-xfer-locking.rb
124
129
  - example/increment.rb
@@ -128,19 +133,21 @@ files:
128
133
  - example/broker-optimistic.rb
129
134
  - example/notify.rb
130
135
  - example/small-simplified.rb
131
- - example/broker-queue.rb
132
136
  - example/async-transaction.rb
133
137
  - example/boolean-match.rb
138
+ - example/dphil.rb
134
139
  - test/lib/testable-worker.rb
135
140
  - test/lib/mock-seq.rb
136
141
  - test/lib/mock-msg.rb
137
142
  - test/lib/mock-queue.rb
143
+ - test/lib/time-fuzz.rb
138
144
  - test/lib/mock-client.rb
139
145
  - test/system/test-archiver.rb
140
146
  - test/unit/test-ops.rb
141
147
  - test/unit/test-mock-seq.rb
142
148
  - test/unit/test-mock-queue.rb
143
149
  - test/stress/concurrent-transactions.rb
150
+ - test/stress/archiver-load.rb
144
151
  - bin/tup
145
152
  - bin/tspy
146
153
  homepage: https://github.com/vjoel/tupelo
@@ -1,33 +0,0 @@
1
- require 'tupelo/app'
2
-
3
- N_PLAYERS = 10
4
-
5
- Tupelo.application do |app|
6
- N_PLAYERS.times do
7
- app.child do |client|
8
- me = client.client_id
9
- opponent = nil
10
- client.write name: me
11
-
12
- arranging_game = client.transaction
13
- arranging_game.async do |t|
14
- t.take name: me
15
- opponent = t.take name: nil
16
- t.write(
17
- player1: me,
18
- player2: opponent)
19
- end
20
-
21
- Thread.new do
22
- game = client.read(
23
- player1: nil,
24
- player2: me)
25
- opponent = game["player1"]
26
- end
27
-
28
- wait
29
- client.log "now playing with #{opponent}"
30
- joining_game.cancel
31
- end
32
- end
33
- end
@@ -1,2 +0,0 @@
1
- # more like how you would do it in redis, except that the queue is not stored in
2
- # the central server, so operations on it are not a bottleneck, FWIW
File without changes