neh 0.0.20 → 0.0.21
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/neh/cli/base.rb +12 -1
- data/lib/neh/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e9a34bc3bc69cf530b83888832f87d576e01223ba302feaf5e723884878a0e91
|
4
|
+
data.tar.gz: 3986b68fa2ff9e119b5cf5a18863d45a6ac11785c8a476fac2680ddec369e209
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5377ead7a8e6c3f86e393152496380ec1f94d2c5f432f8946bb1e463119e8a66edad9c24b5ced9513c7c6b659bcbb3ab569e97eeb0a972ae5d0b7bdd820c9d88
|
7
|
+
data.tar.gz: 20506ca2fe416565e300e7d067b1e358e39c5b8bb7d65a166ce2fbab2128870b4f9ac1883547b6f1a0e950a3daba8f10e0d9a45b0fac417dfa43f7f2a19b89a4
|
data/lib/neh/cli/base.rb
CHANGED
@@ -22,6 +22,8 @@ class Neh::Cli::Base # rubocop:disable Metrics/ClassLength
|
|
22
22
|
@uuid = SecureRandom.uuid
|
23
23
|
url = "ws://#{server_host}:#{server_port}/cable?uuid=#{@uuid}"
|
24
24
|
@endpoint = Async::HTTP::Endpoint.parse(url)
|
25
|
+
@message_pool = {}
|
26
|
+
@expected_sequence_number = 1
|
25
27
|
end
|
26
28
|
|
27
29
|
def execute
|
@@ -74,12 +76,21 @@ class Neh::Cli::Base # rubocop:disable Metrics/ClassLength
|
|
74
76
|
end
|
75
77
|
end
|
76
78
|
|
79
|
+
def process_message_in_order
|
80
|
+
while @message_pool.key?(@expected_sequence_number)
|
81
|
+
print @message_pool.delete(@expected_sequence_number)
|
82
|
+
@expected_sequence_number += 1
|
83
|
+
end
|
84
|
+
end
|
85
|
+
|
77
86
|
def handle_channel_message(connection, message)
|
78
87
|
type = message[:type]
|
88
|
+
sequence_number = message[:sequence_number]
|
79
89
|
|
80
90
|
case type
|
81
91
|
when 'output'
|
82
|
-
|
92
|
+
@message_pool[sequence_number] = message[:message]
|
93
|
+
process_message_in_order
|
83
94
|
when 'worker_done'
|
84
95
|
close(connection)
|
85
96
|
end
|
data/lib/neh/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: neh
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.21
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Atsushi Ishida
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-08-
|
11
|
+
date: 2024-08-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|