async-container 0.27.5 → 0.27.6
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 +4 -4
- checksums.yaml.gz.sig +0 -0
- data/lib/async/container/channel.rb +7 -7
- data/lib/async/container/forked.rb +2 -2
- data/lib/async/container/generic.rb +1 -0
- data/lib/async/container/notify/pipe.rb +2 -2
- data/lib/async/container/threaded.rb +2 -2
- data/lib/async/container/version.rb +1 -1
- data/license.md +1 -0
- data.tar.gz.sig +0 -0
- metadata +2 -1
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e24f5190b56ac438bc6944606f03b532842f4941ddce2aafdd4da22e84ebb2d2
|
4
|
+
data.tar.gz: 7808c2b84c7588a98ff110a3d9409a3daba3dc91d5effe97e6b5e8d6be14a85c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bbcefc876ceea7648bda5543ff6fbfa5756fa19808e7cc725c3a7e3e97be63c3f591227861c8f0aa067ff2559a4f097c951a042b2d30e279300b22a9ced1e2fd
|
7
|
+
data.tar.gz: 04de5a914ebcd62fc58c11daa52bcf35342bd336bee0ac83a2b1f7d2c51c0c2631c08330de70c3ece2d250c37beb6e5f516a6e8b5088f903f160352711bcbc55
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
@@ -1,7 +1,7 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
# Released under the MIT License.
|
4
|
-
# Copyright, 2020-
|
4
|
+
# Copyright, 2020-2025, by Samuel Williams.
|
5
5
|
|
6
6
|
require "json"
|
7
7
|
|
@@ -10,8 +10,9 @@ module Async
|
|
10
10
|
# Provides a basic multi-thread/multi-process uni-directional communication channel.
|
11
11
|
class Channel
|
12
12
|
# Initialize the channel using a pipe.
|
13
|
-
def initialize
|
13
|
+
def initialize(timeout: 1.0)
|
14
14
|
@in, @out = ::IO.pipe
|
15
|
+
@in.timeout = timeout
|
15
16
|
end
|
16
17
|
|
17
18
|
# The input end of the pipe.
|
@@ -43,12 +44,11 @@ module Async
|
|
43
44
|
# @returns [Hash]
|
44
45
|
def receive
|
45
46
|
if data = @in.gets
|
46
|
-
|
47
|
-
return JSON.parse(data, symbolize_names: true)
|
48
|
-
rescue
|
49
|
-
return {line: data}
|
50
|
-
end
|
47
|
+
return JSON.parse(data, symbolize_names: true)
|
51
48
|
end
|
49
|
+
rescue => error
|
50
|
+
Console.error(self, "Error during channel receive!", error)
|
51
|
+
return nil
|
52
52
|
end
|
53
53
|
end
|
54
54
|
end
|
@@ -136,8 +136,8 @@ module Async
|
|
136
136
|
|
137
137
|
# Initialize the process.
|
138
138
|
# @parameter name [String] The name to use for the child process.
|
139
|
-
def initialize(name: nil)
|
140
|
-
super()
|
139
|
+
def initialize(name: nil, **options)
|
140
|
+
super(**options)
|
141
141
|
|
142
142
|
@name = name
|
143
143
|
@status = nil
|
@@ -63,9 +63,9 @@ module Async
|
|
63
63
|
# Formats the message using JSON and sends it to the parent controller.
|
64
64
|
# This is suitable for use with {Channel}.
|
65
65
|
def send(**message)
|
66
|
-
data = ::JSON.dump(message)
|
66
|
+
data = ::JSON.dump(message) << "\n"
|
67
67
|
|
68
|
-
@io.
|
68
|
+
@io.write(data)
|
69
69
|
@io.flush
|
70
70
|
end
|
71
71
|
|
data/license.md
CHANGED
@@ -5,6 +5,7 @@ Copyright, 2019, by Yuji Yaginuma.
|
|
5
5
|
Copyright, 2020, by Olle Jonsson.
|
6
6
|
Copyright, 2020, by Juan Antonio Martín Lucas.
|
7
7
|
Copyright, 2022, by Anton Sozontov.
|
8
|
+
Copyright, 2025, by Marc-André Cournoyer.
|
8
9
|
|
9
10
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
10
11
|
of this software and associated documentation files (the "Software"), to deal
|
data.tar.gz.sig
CHANGED
Binary file
|
metadata
CHANGED
@@ -1,13 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: async-container
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.27.
|
4
|
+
version: 0.27.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Samuel Williams
|
8
8
|
- Olle Jonsson
|
9
9
|
- Anton Sozontov
|
10
10
|
- Juan Antonio Martín Lucas
|
11
|
+
- Marc-André Cournoyer
|
11
12
|
- Yuji Yaginuma
|
12
13
|
bindir: bin
|
13
14
|
cert_chain:
|
metadata.gz.sig
CHANGED
Binary file
|