tupelo 0.14 → 0.15
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +27 -12
- data/bin/tspy +4 -4
- data/bin/tup +28 -18
- data/example/app-and-tup.rb +3 -3
- data/example/broker-queue.rb +35 -0
- data/example/chat/chat-nohistory.rb +2 -2
- data/example/chat/chat.rb +2 -2
- data/example/child-of-child.rb +34 -0
- data/example/fish01.rb +48 -0
- data/example/map-reduce/remote-map-reduce.rb +3 -1
- data/example/pregel/dist-opt.rb +15 -0
- data/example/small.rb +8 -8
- data/example/subspaces/addr-book-v1.rb +106 -0
- data/example/subspaces/sorted-set-space-OLD.rb +130 -0
- data/example/tcp.rb +9 -10
- data/example/tiny-client.rb +4 -4
- data/example/tiny-service.rb +12 -0
- data/lib/tupelo/app/builder.rb +4 -4
- data/lib/tupelo/app.rb +18 -20
- data/lib/tupelo/client/transaction.rb +9 -23
- data/lib/tupelo/client/worker.rb +16 -22
- data/lib/tupelo/client.rb +4 -0
- data/lib/tupelo/version.rb +1 -1
- metadata +96 -91
- data/example/map-reduce/prime-factor-balanced.rb +0 -55
- data/example/tiny-server.rb +0 -12
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
|
+
version: '0.15'
|
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-12-
|
11
|
+
date: 2013-12-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: atdo
|
@@ -84,119 +84,124 @@ files:
|
|
84
84
|
- lib/tupelo/app/trace.rb
|
85
85
|
- lib/tupelo/app/builder.rb
|
86
86
|
- lib/tupelo/client.rb
|
87
|
-
- lib/tupelo/tuplets/persistent-archiver.rb
|
88
|
-
- lib/tupelo/tuplets/persistent-archiver/worker.rb
|
89
|
-
- lib/tupelo/tuplets/persistent-archiver/tuplespace.rb
|
90
|
-
- lib/tupelo/util/boolean.rb
|
91
87
|
- lib/tupelo/app.rb
|
92
88
|
- lib/tupelo/archiver.rb
|
89
|
+
- lib/tupelo/client/worker.rb
|
90
|
+
- lib/tupelo/client/common.rb
|
91
|
+
- lib/tupelo/client/tuplespace.rb
|
92
|
+
- lib/tupelo/client/transaction.rb
|
93
|
+
- lib/tupelo/client/atdo.rb
|
94
|
+
- lib/tupelo/client/reader.rb
|
95
|
+
- lib/tupelo/tuplets/persistent-archiver/worker.rb
|
96
|
+
- lib/tupelo/tuplets/persistent-archiver/tuplespace.rb
|
97
|
+
- lib/tupelo/tuplets/persistent-archiver.rb
|
93
98
|
- lib/tupelo/archiver/persister.rb
|
94
99
|
- lib/tupelo/archiver/worker.rb
|
95
100
|
- lib/tupelo/archiver/tuplespace.rb
|
96
101
|
- lib/tupelo/archiver/persistent-tuplespace.rb
|
97
|
-
- lib/tupelo/
|
98
|
-
- lib/tupelo/client/worker.rb
|
99
|
-
- lib/tupelo/client/reader.rb
|
100
|
-
- lib/tupelo/client/tuplespace.rb
|
101
|
-
- lib/tupelo/client/atdo.rb
|
102
|
-
- lib/tupelo/client/common.rb
|
102
|
+
- lib/tupelo/util/boolean.rb
|
103
103
|
- lib/tupelo/version.rb
|
104
104
|
- bench/pipeline.rb
|
105
105
|
- bugs/read-take.rb
|
106
106
|
- bugs/take-write.rb
|
107
|
+
- example/pubsub.rb
|
108
|
+
- example/timeout-trans.rb
|
109
|
+
- example/fish01.rb
|
110
|
+
- example/tiny-client.rb
|
111
|
+
- example/add.rb
|
112
|
+
- example/parallel.rb
|
113
|
+
- example/socket-broker.rb
|
114
|
+
- example/multi-tier/memo2.rb
|
115
|
+
- example/multi-tier/drb.rb
|
116
|
+
- example/multi-tier/memo.rb
|
117
|
+
- example/multi-tier/kvspace.rb
|
118
|
+
- example/multi-tier/http.rb
|
119
|
+
- example/multi-tier/multi-sinatras.rb
|
120
|
+
- example/app-and-tup.rb
|
121
|
+
- example/small.rb
|
122
|
+
- example/bounded-retry.rb
|
123
|
+
- example/fish.rb
|
124
|
+
- example/zk/lock.rb
|
125
|
+
- example/concurrent-transactions.rb
|
126
|
+
- example/cancel.rb
|
127
|
+
- example/map-reduce/map-reduce-v2.rb
|
128
|
+
- example/map-reduce/remote-map-reduce.rb
|
129
|
+
- example/map-reduce/map-reduce.rb
|
130
|
+
- example/map-reduce/prime-factor.rb
|
131
|
+
- example/write-wait.rb
|
132
|
+
- example/tcp.rb
|
107
133
|
- example/timeout.rb
|
134
|
+
- example/read-in-trans.rb
|
135
|
+
- example/subspaces/simple.rb
|
136
|
+
- example/subspaces/pubsub.rb
|
137
|
+
- example/subspaces/addr-book-v1.rb
|
138
|
+
- example/subspaces/addr-book.rb
|
139
|
+
- example/subspaces/ramp.rb
|
140
|
+
- example/subspaces/addr-book-v2.rb
|
141
|
+
- example/subspaces/sorted-set-space-OLD.rb
|
142
|
+
- example/subspaces/shop/shop-v2.rb
|
143
|
+
- example/subspaces/shop/shop-v1.rb
|
144
|
+
- example/subspaces/sorted-set-space.rb
|
145
|
+
- example/balance-xfer-retry.rb
|
146
|
+
- example/take-nowait-caution.rb
|
147
|
+
- example/lock-mgr-with-queue.rb
|
148
|
+
- example/hash-tuples.rb
|
149
|
+
- example/pulse.rb
|
150
|
+
- example/transaction-logic.rb
|
151
|
+
- example/lease.rb
|
152
|
+
- example/chat/chat.rb
|
153
|
+
- example/chat/chat-nohistory.rb
|
154
|
+
- example/balance-xfer.rb
|
155
|
+
- example/uniq-id.rb
|
108
156
|
- example/add-dsl.rb
|
109
|
-
- example/
|
110
|
-
- example/
|
111
|
-
- example/
|
112
|
-
- example/dphil.rb
|
113
|
-
- example/broker-optimistic.rb
|
157
|
+
- example/lock-mgr.rb
|
158
|
+
- example/broker-locking.rb
|
159
|
+
- example/dphil-optimistic.rb
|
114
160
|
- example/fail-and-retry.rb
|
115
|
-
- example/
|
116
|
-
- example/read-in-trans.rb
|
117
|
-
- example/bounded-retry.rb
|
118
|
-
- example/pregel/remote.rb
|
119
|
-
- example/pregel/pagerank.rb
|
161
|
+
- example/fish0.rb
|
120
162
|
- example/pregel/pregel.rb
|
121
163
|
- example/pregel/distributed.rb
|
164
|
+
- example/pregel/pagerank.rb
|
122
165
|
- example/pregel/update.rb
|
166
|
+
- example/pregel/remote.rb
|
167
|
+
- example/pregel/dist-opt.rb
|
168
|
+
- example/dphil-optimistic-v2.rb
|
169
|
+
- example/broker-optimistic-v2.rb
|
170
|
+
- example/remote.rb
|
123
171
|
- example/take-nowait.rb
|
124
|
-
- example/
|
125
|
-
- example/
|
126
|
-
- example/
|
127
|
-
- example/transaction-logic.rb
|
172
|
+
- example/wait-interrupt.rb
|
173
|
+
- example/tiny-service.rb
|
174
|
+
- example/optimist.rb
|
128
175
|
- example/message-bus.rb
|
129
|
-
- example/small-simplified.rb
|
130
|
-
- example/small.rb
|
131
|
-
- example/lock-mgr.rb
|
132
|
-
- example/take-nowait-caution.rb
|
133
|
-
- example/concurrent-transactions.rb
|
134
|
-
- example/tcp.rb
|
135
|
-
- example/notify.rb
|
136
|
-
- example/pulse.rb
|
137
|
-
- example/chat/chat.rb
|
138
|
-
- example/chat/chat-nohistory.rb
|
139
|
-
- example/hash-tuples.rb
|
140
176
|
- example/balance-xfer-locking.rb
|
141
|
-
- example/
|
177
|
+
- example/increment.rb
|
178
|
+
- example/child-of-child.rb
|
179
|
+
- example/custom-class.rb
|
180
|
+
- example/matching.rb
|
142
181
|
- example/custom-search.rb
|
143
|
-
- example/
|
144
|
-
- example/
|
145
|
-
- example/
|
146
|
-
- example/
|
147
|
-
- example/multi-tier/kvspace.rb
|
148
|
-
- example/multi-tier/memo.rb
|
149
|
-
- example/multi-tier/drb.rb
|
150
|
-
- example/take-many.rb
|
151
|
-
- example/subspaces/ramp.rb
|
152
|
-
- example/subspaces/sorted-set-space.rb
|
153
|
-
- example/subspaces/addr-book.rb
|
154
|
-
- example/subspaces/simple.rb
|
155
|
-
- example/subspaces/shop/shop-v2.rb
|
156
|
-
- example/subspaces/shop/shop-v1.rb
|
157
|
-
- example/subspaces/pubsub.rb
|
158
|
-
- example/subspaces/addr-book-v2.rb
|
159
|
-
- example/dphil-optimistic.rb
|
182
|
+
- example/broker-optimistic.rb
|
183
|
+
- example/notify.rb
|
184
|
+
- example/small-simplified.rb
|
185
|
+
- example/broker-queue.rb
|
160
186
|
- example/async-transaction.rb
|
161
|
-
- example/
|
162
|
-
- example/
|
163
|
-
- example/
|
187
|
+
- example/boolean-match.rb
|
188
|
+
- example/load-balancer.rb
|
189
|
+
- example/take-many.rb
|
164
190
|
- example/deadlock.rb
|
165
|
-
- example/
|
166
|
-
- example/add.rb
|
167
|
-
- example/dphil-optimistic-v2.rb
|
168
|
-
- example/parallel.rb
|
169
|
-
- example/tiny-client.rb
|
170
|
-
- example/map-reduce/map-reduce.rb
|
171
|
-
- example/map-reduce/remote-map-reduce.rb
|
172
|
-
- example/map-reduce/map-reduce-v2.rb
|
173
|
-
- example/map-reduce/prime-factor.rb
|
174
|
-
- example/map-reduce/prime-factor-balanced.rb
|
175
|
-
- example/lock-mgr-with-queue.rb
|
176
|
-
- example/balance-xfer.rb
|
177
|
-
- example/cancel.rb
|
178
|
-
- example/socket-broker.rb
|
179
|
-
- example/timeout-trans.rb
|
180
|
-
- example/uniq-id.rb
|
181
|
-
- example/optimist.rb
|
182
|
-
- example/tiny-server.rb
|
183
|
-
- example/pubsub.rb
|
184
|
-
- example/broker-optimistic-v2.rb
|
185
|
-
- example/write-wait.rb
|
186
|
-
- example/custom-class.rb
|
187
|
-
- test/stress/archiver-load.rb
|
188
|
-
- test/stress/concurrent-transactions.rb
|
189
|
-
- test/system/test-archiver.rb
|
190
|
-
- test/lib/mock-client.rb
|
191
|
-
- test/lib/time-fuzz.rb
|
192
|
-
- test/lib/mock-queue.rb
|
193
|
-
- test/lib/mock-seq.rb
|
191
|
+
- example/dphil.rb
|
194
192
|
- test/lib/testable-worker.rb
|
193
|
+
- test/lib/mock-seq.rb
|
195
194
|
- test/lib/mock-msg.rb
|
196
|
-
- test/
|
197
|
-
- test/
|
195
|
+
- test/lib/mock-queue.rb
|
196
|
+
- test/lib/time-fuzz.rb
|
197
|
+
- test/lib/mock-client.rb
|
198
|
+
- test/system/test-archiver.rb
|
198
199
|
- test/unit/test-ops.rb
|
199
200
|
- test/unit/test-mock-client.rb
|
201
|
+
- test/unit/test-mock-seq.rb
|
202
|
+
- test/unit/test-mock-queue.rb
|
203
|
+
- test/stress/concurrent-transactions.rb
|
204
|
+
- test/stress/archiver-load.rb
|
200
205
|
- bin/tup
|
201
206
|
- bin/tspy
|
202
207
|
homepage: https://github.com/vjoel/tupelo
|
@@ -231,8 +236,8 @@ signing_key:
|
|
231
236
|
specification_version: 4
|
232
237
|
summary: Distributed tuplespace
|
233
238
|
test_files:
|
234
|
-
- test/unit/test-mock-seq.rb
|
235
|
-
- test/unit/test-mock-queue.rb
|
236
239
|
- test/unit/test-ops.rb
|
237
240
|
- test/unit/test-mock-client.rb
|
241
|
+
- test/unit/test-mock-seq.rb
|
242
|
+
- test/unit/test-mock-queue.rb
|
238
243
|
has_rdoc:
|
@@ -1,55 +0,0 @@
|
|
1
|
-
# Factor numbers using remote hosts. Run with --trace to see contention.
|
2
|
-
# This is more "map" than "map-reduce", though you could aggregate the
|
3
|
-
# factored numbers, such as by finding the largest prime factor.
|
4
|
-
|
5
|
-
require 'tupelo/app/remote'
|
6
|
-
|
7
|
-
hosts = ARGV.shift or abort "usage: #$0 <ssh-hostname>,<ssh-hostname>,..."
|
8
|
-
hosts = hosts.split(",")
|
9
|
-
|
10
|
-
Tupelo.tcp_application do
|
11
|
-
hosts.each_with_index do |host, hi|
|
12
|
-
remote host: host, passive: true, eval: %{
|
13
|
-
require 'prime' # ruby stdlib for prime factorization
|
14
|
-
class M
|
15
|
-
def initialize nh, hi
|
16
|
-
@nh, @hi = nh, hi
|
17
|
-
end
|
18
|
-
def === x
|
19
|
-
Array === x and
|
20
|
-
x[0] == "input" and
|
21
|
-
x[1] % @nh == @hi
|
22
|
-
end
|
23
|
-
end
|
24
|
-
my_pref = M.new(#{hosts.size}, #{hi})
|
25
|
-
loop do
|
26
|
-
_, input =
|
27
|
-
begin
|
28
|
-
take(my_pref, timeout: 1.0) # fewer fails (5.0 -> none at all)
|
29
|
-
rescue TimeoutError
|
30
|
-
take(["input", Integer])
|
31
|
-
end
|
32
|
-
write ["output", input, input.prime_division]
|
33
|
-
end
|
34
|
-
}
|
35
|
-
end
|
36
|
-
|
37
|
-
local do
|
38
|
-
t0 = Time.now
|
39
|
-
inputs = 1_000_000_000_000 .. 1_000_000_000_050
|
40
|
-
|
41
|
-
inputs.each do |input|
|
42
|
-
write ["input", input]
|
43
|
-
end
|
44
|
-
|
45
|
-
inputs.size.times do
|
46
|
-
_, input, outputs = take ["output", Integer, nil]
|
47
|
-
output_str = outputs.map {|prime, exp|
|
48
|
-
exp == 1 ? prime : "#{prime}**#{exp}"}.join(" * ")
|
49
|
-
log "#{input} == #{output_str}"
|
50
|
-
end
|
51
|
-
|
52
|
-
t1 = Time.now
|
53
|
-
log "elapsed: %6.2f seconds" % (t1-t0)
|
54
|
-
end
|
55
|
-
end
|
data/example/tiny-server.rb
DELETED