ntl-actor 0.0.1 → 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 4bb4e6d1c16a91e05baee4e50e7dfd15f3b1fe9b
4
- data.tar.gz: 8bba64e0b7e2cf6bb1333db1a543891d3f39a1f6
3
+ metadata.gz: d2b5f7cf07905fa84e2e93b37a742242ac7c2982
4
+ data.tar.gz: dcd77334376788d56811794cefc073a1061ae456
5
5
  SHA512:
6
- metadata.gz: 8515e2123e74493072741078194d021e7ccaa1be0dba3ab7773ef2428aeabc1a05d68b252dbb43a13271b5590b63ebd0aa95521e3c28368ca817df470eaa4ef5
7
- data.tar.gz: 6ecccc370a61eb473b0db1ddf7304075b0c0bcb35ca807637bcb8c2d8ffad3deaaaa7d82ff45b9a55f3fa82a40e78c4ad7146fe4c2e8583264d7b0982ad8fc65
6
+ metadata.gz: e56e7002e0373277cb7b97806c51e3fe3ae03799434da4cc075b1131bf9ac08dca6f0d5bae65c1b0f9d282df1ac37d32e0a96f5735aa4db786572faf6ee61c30
7
+ data.tar.gz: d01a30b07b5224b7a41fae562e35f90383cef8a17711ba97308ddba576d7d338a63a655d31371f2a7b01907934ea32f94b954ffef3a6e7a0d6ab06ef861754fc
data/lib/actor.rb CHANGED
@@ -15,6 +15,7 @@ require 'actor/messaging/reader'
15
15
  require 'actor/messaging/reader/substitute'
16
16
  require 'actor/messaging/writer'
17
17
  require 'actor/messaging/writer/substitute'
18
- require 'actor/messaging/system_message'
18
+
19
+ require 'actor/system_message'
19
20
 
20
21
  require 'actor/actor'
data/lib/actor/actor.rb CHANGED
@@ -25,17 +25,17 @@ module Actor
25
25
 
26
26
  def handle_system_message message
27
27
  case message
28
- when Messaging::SystemMessage::Pause then
28
+ when SystemMessage::Pause then
29
29
  self.actor_state = State::Paused
30
30
 
31
- when Messaging::SystemMessage::Resume then
31
+ when SystemMessage::Resume then
32
32
  self.actor_state = State::Running
33
33
 
34
- when Messaging::SystemMessage::Stop then
34
+ when SystemMessage::Stop then
35
35
  self.actor_state = State::Stopped
36
36
  raise StopIteration
37
37
 
38
- when Messaging::SystemMessage::RecordStatus then
38
+ when SystemMessage::RecordStatus then
39
39
  status = message.status
40
40
 
41
41
  Statistics::Copy.(status, actor_statistics)
@@ -55,7 +55,7 @@ module Actor
55
55
  while message = reader.read(wait: actor_state == State::Paused)
56
56
  handle message
57
57
 
58
- if message.is_a? Messaging::SystemMessage
58
+ if message.is_a? SystemMessage
59
59
  handle_system_message message
60
60
  end
61
61
  end
@@ -118,7 +118,7 @@ module Actor
118
118
  )
119
119
 
120
120
  Messaging::Writer.write(
121
- Messaging::SystemMessage::Resume.new,
121
+ SystemMessage::Resume.new,
122
122
  address
123
123
  )
124
124
 
@@ -0,0 +1,23 @@
1
+ module Actor
2
+ module SystemMessage
3
+ Pause = Class.new { include SystemMessage }
4
+ Resume = Class.new { include SystemMessage }
5
+ Stop = Class.new { include SystemMessage }
6
+
7
+ class RecordStatus
8
+ include SystemMessage
9
+
10
+ attr_reader :reply_address
11
+ attr_reader :status
12
+
13
+ def initialize reply_address
14
+ @reply_address = reply_address
15
+ @status = Status.new
16
+ end
17
+ end
18
+
19
+ class Status < OpenStruct
20
+ include SystemMessage
21
+ end
22
+ end
23
+ end
@@ -38,7 +38,7 @@ module Actor
38
38
  end
39
39
 
40
40
  def record_status_message
41
- Messaging::SystemMessage::RecordStatus.new reply_address
41
+ SystemMessage::RecordStatus.new reply_address
42
42
  end
43
43
  end
44
44
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ntl-actor
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nathan Ladd
@@ -33,7 +33,6 @@ files:
33
33
  - lib/actor/messaging/address.rb
34
34
  - lib/actor/messaging/reader.rb
35
35
  - lib/actor/messaging/reader/substitute.rb
36
- - lib/actor/messaging/system_message.rb
37
36
  - lib/actor/messaging/writer.rb
38
37
  - lib/actor/messaging/writer/substitute.rb
39
38
  - lib/actor/queue.rb
@@ -42,6 +41,7 @@ files:
42
41
  - lib/actor/statistics.rb
43
42
  - lib/actor/statistics/copy.rb
44
43
  - lib/actor/statistics/timer.rb
44
+ - lib/actor/system_message.rb
45
45
  - lib/actor/test_fixtures.rb
46
46
  - lib/actor/test_fixtures/parallel_iteration.rb
47
47
  - lib/actor/test_fixtures/sample_actor_status.rb
@@ -1,25 +0,0 @@
1
- module Actor
2
- module Messaging
3
- module SystemMessage
4
- Pause = Class.new { include SystemMessage }
5
- Resume = Class.new { include SystemMessage }
6
- Stop = Class.new { include SystemMessage }
7
-
8
- class RecordStatus
9
- include SystemMessage
10
-
11
- attr_reader :reply_address
12
- attr_reader :status
13
-
14
- def initialize reply_address
15
- @reply_address = reply_address
16
- @status = Status.new
17
- end
18
- end
19
-
20
- class Status < OpenStruct
21
- include SystemMessage
22
- end
23
- end
24
- end
25
- end