master_loader 1.0.0 → 1.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/master_loader/version.rb +1 -1
- data/lib/master_loader.rb +4 -4
- metadata +21 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0b53788dd7b265f1d35a198b9eeae7130f9901587ae6a4cc407faacfcee0b104
|
4
|
+
data.tar.gz: 26b01fd1504202fa5c7d33c2176e8b6f11d6f88d1ba3563d4f5b5799108a2376
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: dd8b1b14f32d52330b37f283b81229747469e985d1099032d90124d20f4c01622fdeda5a31aeb53a87fa52b1f1e78d6b9c886793588fa24c95bdd9362767d678
|
7
|
+
data.tar.gz: 3c98a152170415b655df19d555534fb87823d7e937686c5267f46b905d26fab9f1f63368b2f77398e3a7ad724faea4d714d9c0173c6aeb592debeec8b3b25446
|
data/lib/master_loader.rb
CHANGED
@@ -7,19 +7,19 @@ class DelayedResult
|
|
7
7
|
|
8
8
|
def then(&block)
|
9
9
|
DelayedResult.new do
|
10
|
-
block.(value!)
|
10
|
+
block.call(value!)
|
11
11
|
end
|
12
12
|
end
|
13
13
|
|
14
14
|
def self.zip(*results, &block)
|
15
15
|
DelayedResult.new do
|
16
16
|
results = results.map(&:value!)
|
17
|
-
block.(*results)
|
17
|
+
block.call(*results)
|
18
18
|
end
|
19
19
|
end
|
20
20
|
|
21
21
|
def value!
|
22
|
-
@value ||= @resolver.().yield_self do |val|
|
22
|
+
@value ||= @resolver.call().yield_self do |val|
|
23
23
|
if val&.is_a?(DelayedResult)
|
24
24
|
val.value!
|
25
25
|
else
|
@@ -68,7 +68,7 @@ class MasterLoader
|
|
68
68
|
@results
|
69
69
|
else
|
70
70
|
@fulfilled = true
|
71
|
-
r = @loader_block.(@queue)
|
71
|
+
r = @loader_block.call(@queue)
|
72
72
|
@results = if r.is_a?(DelayedResult)
|
73
73
|
normalize_results(r.value!)
|
74
74
|
else
|
metadata
CHANGED
@@ -1,17 +1,31 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: master_loader
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Caleb Land
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
12
|
-
dependencies:
|
13
|
-
|
14
|
-
|
11
|
+
date: 2021-09-20 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: concurrent-ruby
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '1.1'
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '1.1'
|
27
|
+
description: A data loading utility to batch loading of promises. It can be used with
|
28
|
+
graphql gem.
|
15
29
|
email:
|
16
30
|
- caleb@land.fm
|
17
31
|
executables: []
|
@@ -22,7 +36,7 @@ files:
|
|
22
36
|
- README.md
|
23
37
|
- lib/master_loader.rb
|
24
38
|
- lib/master_loader/version.rb
|
25
|
-
homepage: https://github.com/caleb/
|
39
|
+
homepage: https://github.com/caleb/strongman
|
26
40
|
licenses:
|
27
41
|
- MIT
|
28
42
|
metadata: {}
|
@@ -41,7 +55,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
41
55
|
- !ruby/object:Gem::Version
|
42
56
|
version: '0'
|
43
57
|
requirements: []
|
44
|
-
rubygems_version: 3.
|
58
|
+
rubygems_version: 3.2.22
|
45
59
|
signing_key:
|
46
60
|
specification_version: 4
|
47
61
|
summary: Batch data loading, works great with graphql
|