asynchronic 3.0.2 → 4.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +1 -0
- data/README.md +1 -1
- data/asynchronic.gemspec +1 -1
- data/lib/asynchronic/data_store/in_memory.rb +21 -16
- data/lib/asynchronic/data_store/key.rb +3 -3
- data/lib/asynchronic/data_store/lazy_value.rb +5 -3
- data/lib/asynchronic/data_store/redis.rb +22 -14
- data/lib/asynchronic/data_store/scoped_store.rb +18 -19
- data/lib/asynchronic/environment.rb +3 -3
- data/lib/asynchronic/error.rb +2 -3
- data/lib/asynchronic/garbage_collector.rb +2 -1
- data/lib/asynchronic/job.rb +12 -12
- data/lib/asynchronic/notifier/broadcaster.rb +8 -4
- data/lib/asynchronic/process.rb +35 -32
- data/lib/asynchronic/queue_engine/in_memory.rb +17 -11
- data/lib/asynchronic/queue_engine/ost.rb +7 -5
- data/lib/asynchronic/queue_engine/synchronic.rb +21 -9
- data/lib/asynchronic/version.rb +1 -1
- data/lib/asynchronic/worker.rb +7 -10
- data/lib/asynchronic.rb +8 -0
- data/spec/data_store/data_store_examples.rb +17 -9
- data/spec/data_store/in_memory_spec.rb +0 -2
- data/spec/data_store/key_spec.rb +1 -1
- data/spec/data_store/lazy_value_examples.rb +7 -5
- data/spec/data_store/redis_spec.rb +4 -10
- data/spec/expectations.rb +2 -2
- data/spec/facade_spec.rb +3 -3
- data/spec/jobs.rb +10 -10
- data/spec/minitest_helper.rb +5 -12
- data/spec/process/life_cycle_examples.rb +24 -22
- data/spec/process/life_cycle_in_memory_spec.rb +0 -1
- data/spec/process/life_cycle_redis_spec.rb +0 -1
- data/spec/queue_engine/in_memory_spec.rb +1 -3
- data/spec/queue_engine/ost_spec.rb +1 -7
- data/spec/queue_engine/queue_engine_examples.rb +17 -9
- data/spec/queue_engine/synchronic_spec.rb +1 -1
- data/spec/worker/in_memory_spec.rb +1 -2
- data/spec/worker/redis_spec.rb +0 -6
- data/spec/worker/worker_examples.rb +6 -4
- metadata +9 -3
data/spec/worker/redis_spec.rb
CHANGED
@@ -1,5 +1,4 @@
|
|
1
1
|
require 'minitest_helper'
|
2
|
-
require_relative './worker_examples'
|
3
2
|
|
4
3
|
describe Asynchronic::Worker, 'Redis' do
|
5
4
|
|
@@ -7,11 +6,6 @@ describe Asynchronic::Worker, 'Redis' do
|
|
7
6
|
let(:data_store) { Asynchronic::DataStore::Redis.new :asynchronic_test}
|
8
7
|
let(:notifier) { Asynchronic::Notifier::Broadcaster.new }
|
9
8
|
|
10
|
-
after do
|
11
|
-
data_store.clear
|
12
|
-
queue_engine.clear
|
13
|
-
end
|
14
|
-
|
15
9
|
include WorkerExamples
|
16
10
|
|
17
11
|
end
|
@@ -1,5 +1,7 @@
|
|
1
1
|
module WorkerExamples
|
2
2
|
|
3
|
+
extend Minitest::Spec::DSL
|
4
|
+
|
3
5
|
let(:env) { Asynchronic::Environment.new queue_engine, data_store, notifier }
|
4
6
|
let(:queue_name) { :test_worker }
|
5
7
|
let(:queue) { env.queue queue_name }
|
@@ -27,7 +29,7 @@ module WorkerExamples
|
|
27
29
|
|
28
30
|
Thread.new do
|
29
31
|
loop { break if queue.empty? }
|
30
|
-
worker.stop
|
32
|
+
worker.stop
|
31
33
|
end
|
32
34
|
|
33
35
|
worker.start
|
@@ -45,10 +47,10 @@ module WorkerExamples
|
|
45
47
|
|
46
48
|
Asynchronic::Worker.start :test_worker do |worker|
|
47
49
|
loop { break if worker.queue.empty? }
|
48
|
-
worker.stop
|
50
|
+
worker.stop
|
49
51
|
end
|
50
|
-
|
51
|
-
processes.each { |p| p.must_be :completed? }
|
52
|
+
|
53
|
+
processes.each { |p| p.must_be :completed? }
|
52
54
|
end
|
53
55
|
|
54
56
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: asynchronic
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 4.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Gabriel Naiman
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2021-12-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: ost
|
@@ -31,6 +31,9 @@ dependencies:
|
|
31
31
|
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
33
|
version: '1.0'
|
34
|
+
- - ">="
|
35
|
+
- !ruby/object:Gem::Version
|
36
|
+
version: 1.0.2
|
34
37
|
type: :runtime
|
35
38
|
prerelease: false
|
36
39
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -38,6 +41,9 @@ dependencies:
|
|
38
41
|
- - "~>"
|
39
42
|
- !ruby/object:Gem::Version
|
40
43
|
version: '1.0'
|
44
|
+
- - ">="
|
45
|
+
- !ruby/object:Gem::Version
|
46
|
+
version: 1.0.2
|
41
47
|
- !ruby/object:Gem::Dependency
|
42
48
|
name: class_config
|
43
49
|
requirement: !ruby/object:Gem::Requirement
|
@@ -291,7 +297,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
291
297
|
- !ruby/object:Gem::Version
|
292
298
|
version: '0'
|
293
299
|
requirements: []
|
294
|
-
rubygems_version: 3.0.
|
300
|
+
rubygems_version: 3.0.8
|
295
301
|
signing_key:
|
296
302
|
specification_version: 4
|
297
303
|
summary: DSL for asynchronic pipeline using queues over Redis
|