Skip to content

Commit a5f0905

Browse files
committed
Add ThreadLocalDispather#status_string.
1 parent f4953d9 commit a5f0905

File tree

3 files changed

+17
-0
lines changed

3 files changed

+17
-0
lines changed

lib/async/job/adapter/active_job/thread_local_dispatcher.rb

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,11 @@ def start(name)
5656
def keys
5757
@definitions.keys
5858
end
59+
60+
# Get the status string for the dispatcher, useful for process titles.
61+
def status_string
62+
dispatcher.status_string
63+
end
5964
end
6065
end
6166
end

releases.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# Releases
22

3+
## Unreleased
4+
5+
- Fixed `ThreadLocalDispatcher` to correctly handle `status_string`.
6+
37
## v0.16.0
48

59
- Add container options for controlling number of workers and health check timeout.

test/async/job/adapter/active_job/thread_local_dispatcher.rb

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,4 +46,12 @@
4646
expect(keys).to be == ["default"]
4747
end
4848
end
49+
50+
with "#status_string" do
51+
it "can get status string from dispatcher" do
52+
expect(thread_local_dispatcher.dispatcher).to receive(:status_string).and_return("default (test)")
53+
54+
expect(thread_local_dispatcher.status_string).to be == "default (test)"
55+
end
56+
end
4957
end

0 commit comments

Comments
 (0)