asynchronic 3.0.3 → 4.0.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (40) hide show
  1. checksums.yaml +4 -4
  2. data/.travis.yml +1 -0
  3. data/README.md +1 -1
  4. data/lib/asynchronic/data_store/in_memory.rb +21 -16
  5. data/lib/asynchronic/data_store/key.rb +3 -3
  6. data/lib/asynchronic/data_store/lazy_value.rb +5 -3
  7. data/lib/asynchronic/data_store/redis.rb +22 -14
  8. data/lib/asynchronic/data_store/scoped_store.rb +18 -19
  9. data/lib/asynchronic/environment.rb +3 -3
  10. data/lib/asynchronic/error.rb +2 -3
  11. data/lib/asynchronic/garbage_collector.rb +2 -1
  12. data/lib/asynchronic/job.rb +12 -12
  13. data/lib/asynchronic/notifier/broadcaster.rb +8 -4
  14. data/lib/asynchronic/process.rb +36 -33
  15. data/lib/asynchronic/queue_engine/in_memory.rb +17 -11
  16. data/lib/asynchronic/queue_engine/ost.rb +7 -5
  17. data/lib/asynchronic/queue_engine/synchronic.rb +21 -9
  18. data/lib/asynchronic/version.rb +1 -1
  19. data/lib/asynchronic/worker.rb +7 -10
  20. data/lib/asynchronic.rb +8 -0
  21. data/spec/data_store/data_store_examples.rb +17 -9
  22. data/spec/data_store/in_memory_spec.rb +0 -2
  23. data/spec/data_store/key_spec.rb +1 -1
  24. data/spec/data_store/lazy_value_examples.rb +7 -5
  25. data/spec/data_store/redis_spec.rb +4 -10
  26. data/spec/expectations.rb +2 -2
  27. data/spec/facade_spec.rb +3 -3
  28. data/spec/jobs.rb +10 -10
  29. data/spec/minitest_helper.rb +5 -12
  30. data/spec/process/life_cycle_examples.rb +24 -22
  31. data/spec/process/life_cycle_in_memory_spec.rb +0 -1
  32. data/spec/process/life_cycle_redis_spec.rb +0 -1
  33. data/spec/queue_engine/in_memory_spec.rb +1 -3
  34. data/spec/queue_engine/ost_spec.rb +1 -7
  35. data/spec/queue_engine/queue_engine_examples.rb +17 -9
  36. data/spec/queue_engine/synchronic_spec.rb +1 -1
  37. data/spec/worker/in_memory_spec.rb +1 -2
  38. data/spec/worker/redis_spec.rb +0 -6
  39. data/spec/worker/worker_examples.rb +6 -4
  40. metadata +3 -3
@@ -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: 3.0.3
4
+ version: 4.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gabriel Naiman
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-03-26 00:00:00.000000000 Z
11
+ date: 2022-01-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: ost
@@ -297,7 +297,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
297
297
  - !ruby/object:Gem::Version
298
298
  version: '0'
299
299
  requirements: []
300
- rubygems_version: 3.0.6
300
+ rubygems_version: 3.0.8
301
301
  signing_key:
302
302
  specification_version: 4
303
303
  summary: DSL for asynchronic pipeline using queues over Redis