File tree Expand file tree Collapse file tree
Tests/AblyLiveObjectsTests/Helpers Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -44,8 +44,7 @@ final class Subscriber<each CallbackArg: Sendable>: Sendable {
4444 let invocation = ( repeat each arg)
4545 invocations. append ( invocation)
4646
47- let listeners = self . listeners
48- return {
47+ return { [ listeners] in
4948 for listener in listeners {
5049 listener. callAsFunction ( repeat each invocation)
5150 }
@@ -76,10 +75,11 @@ final class Subscriber<each CallbackArg: Sendable>: Sendable {
7675 let performInvocations = mutex. withLock {
7776 listeners. append ( . init( callback: listener) )
7877
79- let invocations = self . invocations
80- return {
78+ return { [ invocations, callbackQueue] in
8179 for invocation in invocations {
82- listener ( repeat each invocation)
80+ callbackQueue. async {
81+ listener ( repeat each invocation)
82+ }
8383 }
8484 }
8585 }
You can’t perform that action at this time.
0 commit comments