neh 0.0.20 → 0.0.22
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 +13 -0
- 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: a348fb883a6cb05766862daf8761222a2899ab9f6487296d490cdfb1dafee8ad
|
4
|
+
data.tar.gz: '04319db4bc44ab64d7efc0425ccaef06a08baeb960a4613abba4e558f24ee54d'
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 34e7279aa665e9782e2ae78626f36b4f7e94b4163e979a08746cc6fc8ca25af8845256b51739bb4d951a059e82dcbd53c326fe91ce3c51bd8a356d5eb80c729e
|
7
|
+
data.tar.gz: 10b7893ee7fca52b57c3a0872a9136d83258f3602e2fe2742bc22d792c482b2b5b8649dee26e841c67b6009b803bb4ebf2ade8e7dc0212c12149f47a98f73b9d
|
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,11 +76,22 @@ 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'
|
92
|
+
@message_pool[sequence_number] = message[:message]
|
93
|
+
process_message_in_order
|
94
|
+
when 'error'
|
82
95
|
print message[:message]
|
83
96
|
when 'worker_done'
|
84
97
|
close(connection)
|
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.22
|
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-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|