async-container 0.21.0 → 0.22.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
  SHA256:
3
- metadata.gz: 6dd27e02912c5f1258419c9821da1bd97d58f4fd68b4a58512b3ebd5291c5b6b
4
- data.tar.gz: 36fc9d2d0ce94a0e2591beac3384d2fba288094a93c1ada7a9000841c1e78a59
3
+ metadata.gz: 97b99976b04ac8d7725349a23176ff2ca94643a4e95c96b6ab566a957be437d7
4
+ data.tar.gz: ec7aa60548299430c13b14d6abee5df28ec383b48dafb7e60432574bd07dd6fb
5
5
  SHA512:
6
- metadata.gz: 162f3604bbaa973b486fc271ccf61106008a5d2259f114134535188349267ee3dfb81cbe857ce7edc49dd2037b5d1f5581dd531955ddbfba264a113638e300cd
7
- data.tar.gz: b1ba5f8e3b96976a97b6f81e20a62efbcbde89e4e2f0be43c754954a44924e2553c447cf275121ce74894d0044e7677a144c7f43df5f77d7a55b263f6442eb96
6
+ metadata.gz: 8b44d6496b6b9fa16bc288ecc66f0ba0645a0b3301d2a32bf53fbf27f993803cba38b6da9208baa3ef6c14fececb9da65cda6ab8d8ae403aa04c666c4077c978
7
+ data.tar.gz: 61d79bd5e62d8b406ffe88aae129918b5ab7c3de779847e8295e6dff867fdc58573c68e7df7bee585b9b204c6150dd98bc82fc424c8c6643df7eedd9dbd11f7c
checksums.yaml.gz.sig CHANGED
Binary file
@@ -41,12 +41,24 @@ module Async
41
41
  @name = nil
42
42
  end
43
43
 
44
+ def as_json(...)
45
+ {
46
+ process_id: ::Process.pid,
47
+ name: @name,
48
+ }
49
+ end
50
+
51
+ def to_json(...)
52
+ as_json.to_json(...)
53
+ end
54
+
44
55
  # Set the process title to the specified value.
45
56
  # @parameter value [String] The name of the process.
46
57
  def name= value
47
- if @name = value
48
- ::Process.setproctitle(@name)
49
- end
58
+ @name = value
59
+
60
+ # This sets the process title to an empty string if the name is nil:
61
+ ::Process.setproctitle(@name.to_s)
50
62
  end
51
63
 
52
64
  # The name of the process.
@@ -53,12 +53,23 @@ module Async
53
53
  end
54
54
 
55
55
  def initialize(io)
56
- @name = nil
57
56
  @thread = ::Thread.current
58
57
 
59
58
  super
60
59
  end
61
60
 
61
+ def as_json(...)
62
+ {
63
+ process_id: ::Process.pid,
64
+ thread_id: @thread.object_id,
65
+ name: @thread.name,
66
+ }
67
+ end
68
+
69
+ def to_json(...)
70
+ as_json.to_json(...)
71
+ end
72
+
62
73
  # Set the name of the thread.
63
74
  # @parameter value [String] The name to set.
64
75
  def name= value
@@ -5,6 +5,6 @@
5
5
 
6
6
  module Async
7
7
  module Container
8
- VERSION = "0.21.0"
8
+ VERSION = "0.22.0"
9
9
  end
10
10
  end
data.tar.gz.sig CHANGED
Binary file
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: async-container
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.21.0
4
+ version: 0.22.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Samuel Williams
@@ -40,7 +40,7 @@ cert_chain:
40
40
  Q2K9NVun/S785AP05vKkXZEFYxqG6EW012U4oLcFl5MySFajYXRYbuUpH6AY+HP8
41
41
  voD0MPg1DssDLKwXyt1eKD/+Fq0bFWhwVM/1XiAXL7lyYUyOq24KHgQ2Csg=
42
42
  -----END CERTIFICATE-----
43
- date: 2025-02-20 00:00:00.000000000 Z
43
+ date: 2025-02-26 00:00:00.000000000 Z
44
44
  dependencies:
45
45
  - !ruby/object:Gem::Dependency
46
46
  name: async
metadata.gz.sig CHANGED
Binary file