ntl-actor 1.3.0 → 1.4.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 3ac91f6f55c430b898dc4ad968d5080ac002bce42d2d9b9015276b538bdb52db
4
- data.tar.gz: aaad5df8588557f244bc2c98c65b5c660da7c64676907a72e65c05932a208044
3
+ metadata.gz: f13d4d98998e8545edb0339b4c99114f9aca0d329752f32bd8ffff1af8405aff
4
+ data.tar.gz: 35a076fe76b028acab5cb7ff50ba33ded3c30da2b28e41db0ac15865daff1425
5
5
  SHA512:
6
- metadata.gz: fce84972bbb8f6eaaa08ba28e04951f30722eca448323e79c675aeca93fadbab4dcc6d82f04bed0f28efbd3fd11ac9809861e724287321e308abfd7324693cb9
7
- data.tar.gz: 5570b5bfdabbd337d5c161dd7367bae5c9b1ef6259540d41d5a32fc090e821c957034142b949962aac99322bbe2b27bb81bdc1dba33dab6c6b35445a91db89c1
6
+ metadata.gz: d52e098b26cf0970d9a9e004d7eaff65ad026110f09a15aaea0e664332db1e88f60d3fa4c4345ead984ce76e4d110ee7ac22e4a9f5cc1d84c82ff87d4cd08e2b
7
+ data.tar.gz: c15455bf367450b34083feea4c380094775016eb871fd3566723351be0bd7dff4478196e9c1b5316b49b3767cb4bb7409a1a2aa302efcb756fbc2dc996ca99a5
data/lib/actor/build.rb CHANGED
@@ -1,17 +1,19 @@
1
1
  module Actor
2
2
  class Build
3
3
  attr_reader :arguments
4
+ attr_reader :keyword_arguments
4
5
  attr_reader :block
5
6
  attr_reader :cls
6
7
 
7
- def initialize cls, arguments, &block
8
+ def initialize cls, arguments, keyword_arguments, &block
8
9
  @arguments = arguments
10
+ @keyword_arguments = keyword_arguments
9
11
  @block = block
10
12
  @cls = cls
11
13
  end
12
14
 
13
- def self.call cls, *arguments, &block
14
- instance = new cls, arguments, &block
15
+ def self.call cls, *arguments, **keyword_arguments, &block
16
+ instance = new cls, arguments, keyword_arguments, &block
15
17
  instance.()
16
18
  end
17
19
 
@@ -23,9 +25,9 @@ module Actor
23
25
  end
24
26
 
25
27
  if block
26
- actor = method.(*arguments, &block)
28
+ actor = method.(*arguments, **keyword_arguments, &block)
27
29
  else
28
- actor = method.(*arguments)
30
+ actor = method.(*arguments, **keyword_arguments)
29
31
  end
30
32
 
31
33
  actor.configure
@@ -2,9 +2,7 @@ module Actor
2
2
  module Module
3
3
  module Start
4
4
  def start *arguments, include: nil, **keyword_arguments, &block
5
- arguments << keyword_arguments if keyword_arguments.any?
6
-
7
- actor, thread = Actor::Start.(self, *arguments, &block)
5
+ actor, thread = Actor::Start.(self, *arguments, **keyword_arguments, &block)
8
6
 
9
7
  address = actor.address
10
8
 
@@ -2,7 +2,7 @@ module Actor
2
2
  module Module
3
3
  module SuspendResume
4
4
  module Initialize
5
- def initialize *;
5
+ def initialize ...
6
6
  @suspended = false
7
7
 
8
8
  super
data/lib/actor/start.rb CHANGED
@@ -9,11 +9,11 @@ module Actor
9
9
  @actor = actor
10
10
  end
11
11
 
12
- def self.call actor_or_actor_class, *arguments, &block
12
+ def self.call actor_or_actor_class, *arguments, **keyword_arguments, &block
13
13
  if actor_or_actor_class.is_a? Actor and not actor_or_actor_class.is_a? Class
14
14
  actor = actor_or_actor_class
15
15
  else
16
- actor = Build.(actor_or_actor_class, *arguments, &block)
16
+ actor = Build.(actor_or_actor_class, *arguments, **keyword_arguments, &block)
17
17
  end
18
18
 
19
19
  instance = new actor
@@ -60,7 +60,14 @@ module Actor
60
60
  end
61
61
 
62
62
  handle Messages::ActorStarted do |message|
63
- publish.register message.address
63
+ actor_address = message.address
64
+
65
+ if error
66
+ send.(Messages::Stop, actor_address)
67
+ return
68
+ end
69
+
70
+ publish.register actor_address
64
71
 
65
72
  self.actor_count += 1
66
73
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ntl-actor
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.0
4
+ version: 1.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nathan Ladd
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-10-15 00:00:00.000000000 Z
11
+ date: 2022-11-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: test_bench
@@ -76,7 +76,7 @@ homepage: https://github.com/ntl/actor
76
76
  licenses:
77
77
  - MIT
78
78
  metadata: {}
79
- post_install_message:
79
+ post_install_message:
80
80
  rdoc_options: []
81
81
  require_paths:
82
82
  - lib
@@ -92,8 +92,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
92
92
  - !ruby/object:Gem::Version
93
93
  version: '0'
94
94
  requirements: []
95
- rubygems_version: 3.0.1
96
- signing_key:
95
+ rubygems_version: 3.3.23
96
+ signing_key:
97
97
  specification_version: 4
98
98
  summary: Implementation of actor pattern for Ruby
99
99
  test_files: []