Skip to content

Commit 0f0dbda

Browse files
Client#run returns a task.
1 parent d7d3cc3 commit 0f0dbda

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

lib/async/bus/client.rb

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,9 +63,10 @@ def connect(parent: Task.current)
6363
# Automatically reconnects when the connection fails, with random backoff.
6464
# This is useful for long-running clients that need to maintain a persistent connection.
6565
#
66-
# @parameter parent [Async::Task] The parent task to run under.
67-
def run
68-
Sync do |task|
66+
# @yields {|connection| ...} If a block is given, it will be called with the connection.
67+
# @returns [Async::Task] The task that runs the client.
68+
def run(&block)
69+
Async(transient: true) do |task|
6970
loop do
7071
connection = connect!
7172

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+
- `Client#run` now returns an `Async::Task` (as it did in earlier releases).
6+
37
## v0.3.0
48

59
- Add support for multi-hop proxying.

0 commit comments

Comments
 (0)