async 2.27.0 → 2.28.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.
@@ -14,18 +14,18 @@ Traces::Provider(Async::Task) do
14
14
  end
15
15
 
16
16
  unless self.transient?
17
- trace_context = Traces.trace_context
17
+ trace_context = Traces.current_context
18
18
  end
19
19
 
20
20
  attributes = {
21
21
  # We use the instance variable as it corresponds to the user-provided block.
22
- "block" => @block,
22
+ "block" => @block.to_s,
23
23
  "transient" => self.transient?,
24
24
  }
25
25
 
26
26
  # Run the trace in the context of the child task:
27
27
  super do
28
- Traces.trace_context = trace_context
28
+ Traces.with_context(trace_context)
29
29
 
30
30
  if annotation = self.annotation
31
31
  attributes["annotation"] = annotation
data/license.md CHANGED
@@ -32,6 +32,8 @@ Copyright, 2025, by Mark Montroy.
32
32
  Copyright, 2025, by Shigeru Nakajima.
33
33
  Copyright, 2025, by Alan Wu.
34
34
  Copyright, 2025, by Shopify Inc.
35
+ Copyright, 2025, by Josh Teeter.
36
+ Copyright, 2025, by Jatin Goyal.
35
37
 
36
38
  Permission is hereby granted, free of charge, to any person obtaining a copy
37
39
  of this software and associated documentation files (the "Software"), to deal
data/readme.md CHANGED
@@ -21,20 +21,40 @@ Please see the [project documentation](https://socketry.github.io/async/) for mo
21
21
 
22
22
  - [Getting Started](https://socketry.github.io/async/guides/getting-started/index) - This guide shows how to add async to your project and run code asynchronously.
23
23
 
24
- - [Asynchronous Tasks](https://socketry.github.io/async/guides/asynchronous-tasks/index) - This guide explains how asynchronous tasks work and how to use them.
25
-
26
24
  - [Scheduler](https://socketry.github.io/async/guides/scheduler/index) - This guide gives an overview of how the scheduler is implemented.
27
25
 
28
- - [Compatibility](https://socketry.github.io/async/guides/compatibility/index) - This guide gives an overview of the compatibility of Async with Ruby and other frameworks.
26
+ - [Tasks](https://socketry.github.io/async/guides/tasks/index) - This guide explains how asynchronous tasks work and how to use them.
29
27
 
30
28
  - [Best Practices](https://socketry.github.io/async/guides/best-practices/index) - This guide gives an overview of best practices for using Async.
31
29
 
32
30
  - [Debugging](https://socketry.github.io/async/guides/debugging/index) - This guide explains how to debug issues with programs that use Async.
33
31
 
32
+ - [Thread safety](https://socketry.github.io/async/guides/thread-safety/index) - This guide explains thread safety in Ruby, focusing on fibers and threads, common pitfalls, and best practices to avoid problems like data corruption, race conditions, and deadlocks.
33
+
34
34
  ## Releases
35
35
 
36
36
  Please see the [project releases](https://socketry.github.io/async/releases/index) for all releases.
37
37
 
38
+ ### v2.28.0
39
+
40
+ - Use `Traces.current_context` and `Traces.with_context` for better integration with OpenTelemetry.
41
+
42
+ ### v2.27.4
43
+
44
+ - Suppress excessive warning in `Async::Scheduler#async`.
45
+
46
+ ### v2.27.3
47
+
48
+ - Ensure trace attributes are strings, fixes integration with OpenTelemetry.
49
+
50
+ ### v2.27.2
51
+
52
+ - Fix `context/index.yaml` schema.
53
+
54
+ ### v2.27.1
55
+
56
+ - Updated documentation and agent context.
57
+
38
58
  ### v2.27.0
39
59
 
40
60
  - `Async::Task#stop` supports an optional `cause:` argument (that defaults to `$!`), which allows you to specify the cause (exception) for stopping the task.
@@ -68,27 +88,6 @@ Please see the [project releases](https://socketry.github.io/async/releases/inde
68
88
  - Rename `ASYNC_SCHEDULER_DEFAULT_WORKER_POOL` to `ASYNC_SCHEDULER_WORKER_POOL`.
69
89
  - [Fiber Stall Profiler](https://socketry.github.io/async/releases/index#fiber-stall-profiler)
70
90
 
71
- ### v2.21.1
72
-
73
- - [Worker Pool](https://socketry.github.io/async/releases/index#worker-pool)
74
-
75
- ### v2.20.0
76
-
77
- - [Traces and Metrics Providers](https://socketry.github.io/async/releases/index#traces-and-metrics-providers)
78
-
79
- ### v2.19.0
80
-
81
- - [`Async::Scheduler` Debugging](https://socketry.github.io/async/releases/index#async::scheduler-debugging)
82
- - [Console Shims](https://socketry.github.io/async/releases/index#console-shims)
83
-
84
- ### v2.18.0
85
-
86
- - Add support for `Sync(annotation:)`, so that you can annotate the block with a description of what it does, even if it doesn't create a new task.
87
-
88
- ### v2.17.0
89
-
90
- - Introduce `Async::Queue#push` and `Async::Queue#pop` for compatibility with `::Queue`.
91
-
92
91
  ## See Also
93
92
 
94
93
  - [async-http](https://github.com/socketry/async-http) — Asynchronous HTTP client/server.
data/releases.md CHANGED
@@ -1,5 +1,25 @@
1
1
  # Releases
2
2
 
3
+ ## v2.28.0
4
+
5
+ - Use `Traces.current_context` and `Traces.with_context` for better integration with OpenTelemetry.
6
+
7
+ ## v2.27.4
8
+
9
+ - Suppress excessive warning in `Async::Scheduler#async`.
10
+
11
+ ## v2.27.3
12
+
13
+ - Ensure trace attributes are strings, fixes integration with OpenTelemetry.
14
+
15
+ ## v2.27.2
16
+
17
+ - Fix `context/index.yaml` schema.
18
+
19
+ ## v2.27.1
20
+
21
+ - Updated documentation and agent context.
22
+
3
23
  ## v2.27.0
4
24
 
5
25
  - `Async::Task#stop` supports an optional `cause:` argument (that defaults to `$!`), which allows you to specify the cause (exception) for stopping the task.
data.tar.gz.sig CHANGED
Binary file
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: async
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.27.0
4
+ version: 2.28.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Samuel Williams
@@ -20,7 +20,9 @@ authors:
20
20
  - Dimitar Peychinov
21
21
  - Gert Goet
22
22
  - Jahfer Husain
23
+ - Jatin Goyal
23
24
  - Jiang Jinyang
25
+ - Josh Teeter
24
26
  - Julien Portalier
25
27
  - Jun Jiang
26
28
  - Ken Muryoi
@@ -131,19 +133,26 @@ dependencies:
131
133
  requirements:
132
134
  - - "~>"
133
135
  - !ruby/object:Gem::Version
134
- version: '0.15'
136
+ version: '0.18'
135
137
  type: :runtime
136
138
  prerelease: false
137
139
  version_requirements: !ruby/object:Gem::Requirement
138
140
  requirements:
139
141
  - - "~>"
140
142
  - !ruby/object:Gem::Version
141
- version: '0.15'
143
+ version: '0.18'
142
144
  executables: []
143
145
  extensions: []
144
146
  extra_rdoc_files: []
145
147
  files:
146
148
  - agent.md
149
+ - context/best-practices.md
150
+ - context/debugging.md
151
+ - context/getting-started.md
152
+ - context/index.yaml
153
+ - context/scheduler.md
154
+ - context/tasks.md
155
+ - context/thread-safety.md
147
156
  - lib/async.rb
148
157
  - lib/async/barrier.md
149
158
  - lib/async/barrier.rb
@@ -199,7 +208,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
199
208
  - !ruby/object:Gem::Version
200
209
  version: '0'
201
210
  requirements: []
202
- rubygems_version: 3.6.7
211
+ rubygems_version: 3.6.9
203
212
  specification_version: 4
204
213
  summary: A concurrency framework for Ruby.
205
214
  test_files: []
metadata.gz.sig CHANGED
Binary file