parallax 0.3.1 → 0.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +3 -1
- data/README.md +1 -1
- data/Rakefile +4 -0
- data/lib/parallax/collectable.rb +2 -2
- data/lib/parallax/version.rb +1 -1
- data/lib/parallax/worker.rb +1 -1
- data/lib/parallax.rb +1 -0
- data/parallax.gemspec +1 -0
- metadata +16 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: aa828168056738a40c6c1b46c736ff17c1149add1bcee80a91f4b7a6524cdcda
|
4
|
+
data.tar.gz: 03076a28ea96c17b8a7eaab231e437479d5a3372670173ea647f573e3463b33a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 74e0149d570425c14c55ee7f5949f5f68444eebdf48d0b7ef30860067635cbfad3d264c4bb0a712f94ca16ac79dc869fc6b4f143ed6c6f4e52e1c1f9ecf2154e
|
7
|
+
data.tar.gz: 7a4cf5bc2c044a9c42266b901657d91ec4e6031f5a59b20d9c2b43fce66803f7ca5eb614ad531867459a4ef7b10153ea48d25cf6cad5edbc236a7360748aa471
|
data/Gemfile.lock
CHANGED
@@ -1,8 +1,9 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
parallax (0.
|
4
|
+
parallax (0.4.0)
|
5
5
|
activesupport
|
6
|
+
msgpack
|
6
7
|
|
7
8
|
GEM
|
8
9
|
remote: https://rubygems.org/
|
@@ -70,6 +71,7 @@ GEM
|
|
70
71
|
mini_mime (1.0.1)
|
71
72
|
mini_portile2 (2.4.0)
|
72
73
|
minitest (5.11.3)
|
74
|
+
msgpack (1.2.4)
|
73
75
|
nio4r (2.3.1)
|
74
76
|
nokogiri (1.9.1)
|
75
77
|
mini_portile2 (~> 2.4.0)
|
data/README.md
CHANGED
@@ -42,7 +42,7 @@ end
|
|
42
42
|
|
43
43
|
If you need inter-process communication, this can be done by calling `worker.send` and passing a list of arguments. The args are serialized and passed via IO pipe to a `collector` object, which is by default an instance of `Parallax::Collector` class. The collector then parses the args and treats them like a method call where the first arg is the name of the method.
|
44
44
|
|
45
|
-
There are a number of predefined methods,
|
45
|
+
There are a number of predefined methods, built on top of `worker.send` that you can call to do a number of tasks:
|
46
46
|
* `log`: Used in the example above, the collectors calls the `log` method which prints the message to the stdout.
|
47
47
|
* `store`: Saves the argument object into a variable called `workers_data` in the collector.
|
48
48
|
|
data/Rakefile
CHANGED
data/lib/parallax/collectable.rb
CHANGED
@@ -33,7 +33,7 @@ module Parallax
|
|
33
33
|
#
|
34
34
|
# @return [String] the received data.
|
35
35
|
def receive
|
36
|
-
self.collect @receiving_stream.gets.chomp
|
36
|
+
self.collect @receiving_stream.gets.chomp.gsub("\t", "\n")
|
37
37
|
end
|
38
38
|
|
39
39
|
##
|
@@ -44,7 +44,7 @@ module Parallax
|
|
44
44
|
#
|
45
45
|
# @return [Object] the execution of the interpreted method.
|
46
46
|
def collect(message)
|
47
|
-
worker_index, method, *arguments =
|
47
|
+
worker_index, method, *arguments = YAML.load(message)
|
48
48
|
self.send method, worker_index, *arguments
|
49
49
|
end
|
50
50
|
|
data/lib/parallax/version.rb
CHANGED
data/lib/parallax/worker.rb
CHANGED
data/lib/parallax.rb
CHANGED
data/parallax.gemspec
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: parallax
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Francesco Ballardin
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-12-
|
11
|
+
date: 2018-12-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -24,6 +24,20 @@ dependencies:
|
|
24
24
|
- - ">="
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '0'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: msgpack
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - ">="
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '0'
|
34
|
+
type: :runtime
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - ">="
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '0'
|
27
41
|
- !ruby/object:Gem::Dependency
|
28
42
|
name: bundler
|
29
43
|
requirement: !ruby/object:Gem::Requirement
|