async-job-adapter-active_job 0.16.3 → 0.18.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: b0c569546d84716c698c454c8059a052ecf04c033f67ef25b464f46c73667390
4
- data.tar.gz: b2fc8649e06a089da7e691319fc9f7bdb430c5120c3854b9b8ae84a0b61d9c9c
3
+ metadata.gz: a8e58a14e2ed8c77cfdb2bbb39e9f270703c2372cf3b2fe4067edc0e85567e1b
4
+ data.tar.gz: 296b8c3fe85bb14f07b72f13e889548961ba667c3c6826dde0ca3b9c11c91a5e
5
5
  SHA512:
6
- metadata.gz: 8d828d19b11a6665c7e29df326c2bd9617862b1b8a3ef6e33eaeceb4329bd5ace2b5ab64349b306fd09f3f9a6bbecfb4c76f7a869bf6a1023a403c99ba3a9986
7
- data.tar.gz: 6d18ec31378c101ab866ff430086aa7a00c87e0624dbb831cb1102c5fa12d9bbb42f847a7efa741ce31220565dde7ec02407a9e533f0cba1c29ae90f9ec8b1e2
6
+ metadata.gz: 74f1bf5255b7013d6f5b063fbed86d9958559b6c428f1a8541b1c804296ee316b1cc0f299e5cc0b9776f7d7c3134f27ea2dcfb45cfb387b31c5e44aca09ab87e
7
+ data.tar.gz: c50ed2db01acaa76ced02b4ad6c46946c9863d9a01e3221b81166ea773111c0774a06dab923ccab28fd9eb4219cd5e2c5dd5ca87206bd2949e529cb68d300fc0
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, 2024, by Samuel Williams.
4
+ # Copyright, 2024-2025, by Samuel Williams.
5
5
 
6
6
  require "active_job/queue_adapters/abstract_adapter"
7
7
 
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  # Released under the MIT License.
4
- # Copyright, 2024, by Samuel Williams.
4
+ # Copyright, 2024-2025, by Samuel Williams.
5
5
 
6
6
  require_relative "executor"
7
7
 
@@ -62,9 +62,12 @@ module Async
62
62
  end
63
63
 
64
64
  def status_string
65
- @queues.map do |name, queue|
66
- if queue.respond_to?(:status_string)
67
- "#{name} (#{queue.status_string})"
65
+ self.keys.map do |name|
66
+ queue = @queues[name]
67
+ server = queue&.server
68
+
69
+ if server&.respond_to?(:status_string)
70
+ "#{name} #{server.status_string}"
68
71
  else
69
72
  name
70
73
  end
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  # Released under the MIT License.
4
- # Copyright, 2024, by Samuel Williams.
4
+ # Copyright, 2024-2025, by Samuel Williams.
5
5
 
6
6
  require_relative "service"
7
7
 
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  # Released under the MIT License.
4
- # Copyright, 2024, by Samuel Williams.
4
+ # Copyright, 2024-2025, by Samuel Williams.
5
5
 
6
6
  require "json"
7
7
 
@@ -1,11 +1,14 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  # Released under the MIT License.
4
- # Copyright, 2024, by Samuel Williams.
4
+ # Copyright, 2024-2025, by Samuel Williams.
5
5
 
6
6
  require "async/job"
7
7
  require "async/job/processor/inline"
8
8
 
9
+ # For `config.active_support.isolation_level`.
10
+ require "active_support/railtie"
11
+
9
12
  require_relative "thread_local_dispatcher"
10
13
 
11
14
  module Async
@@ -65,6 +68,9 @@ module Async
65
68
  end
66
69
 
67
70
  config.async_job = self
71
+
72
+ # Ensure we have per-fiber isolation:
73
+ config.active_support.isolation_level = :fiber
68
74
  end
69
75
  end
70
76
  end
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  # Released under the MIT License.
4
- # Copyright, 2024, by Samuel Williams.
4
+ # Copyright, 2024-2025, by Samuel Williams.
5
5
 
6
6
  require "async/service/generic"
7
7
  require "console/event/failure"
@@ -29,17 +29,17 @@ module Async
29
29
 
30
30
  instance.ready!
31
31
 
32
- if health_check_timeout
33
- Async(transient: true) do
34
- while true
35
- instance.name = "#{self.name} (#{dispatcher.status_string})"
36
- sleep(health_check_timeout / 2)
37
- instance.ready!
32
+ Sync do |task|
33
+ if health_check_timeout
34
+ task.async(transient: true) do
35
+ while true
36
+ instance.name = "#{self.name} (#{dispatcher.status_string})"
37
+ sleep(health_check_timeout / 2)
38
+ instance.ready!
39
+ end
38
40
  end
39
41
  end
40
- end
41
-
42
- Sync do |task|
42
+
43
43
  barrier = Async::Barrier.new
44
44
 
45
45
  # Start all the named queues:
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  # Released under the MIT License.
4
- # Copyright, 2024, by Samuel Williams.
4
+ # Copyright, 2024-2025, by Samuel Williams.
5
5
 
6
6
  require_relative "dispatcher"
7
7
 
@@ -1,13 +1,13 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  # Released under the MIT License.
4
- # Copyright, 2024, by Samuel Williams.
4
+ # Copyright, 2024-2025, by Samuel Williams.
5
5
 
6
6
  module Async
7
7
  module Job
8
8
  module Adapter
9
9
  module ActiveJob
10
- VERSION = "0.16.3"
10
+ VERSION = "0.18.0"
11
11
  end
12
12
  end
13
13
  end
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  # Released under the MIT License.
4
- # Copyright, 2024, by Samuel Williams.
4
+ # Copyright, 2024-2025, by Samuel Williams.
5
5
 
6
6
  require_relative "active_job/version"
7
7
  require_relative "active_job/executor"
data/license.md CHANGED
@@ -1,7 +1,8 @@
1
1
  # MIT License
2
2
 
3
- Copyright, 2024, by Samuel Williams.
3
+ Copyright, 2024-2025, by Samuel Williams.
4
4
  Copyright, 2024, by Trevor Turk.
5
+ Copyright, 2025, by Paul Shippy.
5
6
 
6
7
  Permission is hereby granted, free of charge, to any person obtaining a copy
7
8
  of this software and associated documentation files (the "Software"), to deal
data/readme.md CHANGED
@@ -14,6 +14,14 @@ Please see the [project documentation](https://socketry.github.io/async-job-adap
14
14
 
15
15
  Please see the [project releases](https://socketry.github.io/async-job-adapter-active_job/releases/index) for all releases.
16
16
 
17
+ ### v0.18.0
18
+
19
+ - Default to per-fiber isolation.
20
+
21
+ ### v0.17.0
22
+
23
+ - Fix health check.
24
+
17
25
  ### v0.16.3
18
26
 
19
27
  - Actually use `container_options`. I have been working too much.
@@ -56,14 +64,6 @@ Please see the [project releases](https://socketry.github.io/async-job-adapter-a
56
64
  - Remove `thread-local` gem dependency.
57
65
  - Improve error handling - don't log failures as ActiveJob already handles this.
58
66
 
59
- ### v0.12.1
60
-
61
- - Force string names for queue identifiers, fixes \#5.
62
-
63
- ### v0.12.0
64
-
65
- - Improved error handling - let ActiveJob handle retry logic.
66
-
67
67
  ## Contributing
68
68
 
69
69
  We welcome contributions to this project.
data/releases.md CHANGED
@@ -1,5 +1,13 @@
1
1
  # Releases
2
2
 
3
+ ## v0.18.0
4
+
5
+ - Default to per-fiber isolation.
6
+
7
+ ## v0.17.0
8
+
9
+ - Fix health check.
10
+
3
11
  ## v0.16.3
4
12
 
5
13
  - Actually use `container_options`. I have been working too much.
data.tar.gz.sig CHANGED
Binary file
metadata CHANGED
@@ -1,10 +1,11 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: async-job-adapter-active_job
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.16.3
4
+ version: 0.18.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Samuel Williams
8
+ - Paul Shippy
8
9
  - Trevor Turk
9
10
  bindir: bin
10
11
  cert_chain:
@@ -105,7 +106,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
105
106
  - !ruby/object:Gem::Version
106
107
  version: '0'
107
108
  requirements: []
108
- rubygems_version: 3.6.7
109
+ rubygems_version: 3.6.9
109
110
  specification_version: 4
110
111
  summary: A asynchronous job queue for Ruby on Rails.
111
112
  test_files: []
metadata.gz.sig CHANGED
Binary file