@@ -25,11 +25,13 @@ extension ValkeyClient {
25
25
///
26
26
/// - Parameters:
27
27
/// - channels: list of channels to subscribe to
28
+ /// - isolation: Actor isolation
28
29
/// - process: Closure that is called with subscription async sequence
29
30
/// - Returns: Return value of closure
30
31
@inlinable
31
32
public func subscribe< Value> (
32
33
to channels: String ... ,
34
+ isolation: isolated ( any Actor ) ? = #isolation,
33
35
process: ( ValkeySubscription ) async throws -> sending Value
34
36
) async throws -> Value {
35
37
try await self . subscribe ( to: channels, process: process)
@@ -45,10 +47,12 @@ extension ValkeyClient {
45
47
///
46
48
/// - Parameters:
47
49
/// - channels: list of channels to subscribe to
50
+ /// - isolation: Actor isolation
48
51
/// - process: Closure that is called with subscription async sequence
49
52
/// - Returns: Return value of closure
50
53
public func subscribe< Value> (
51
54
to channels: [ String ] ,
55
+ isolation: isolated ( any Actor ) ? = #isolation,
52
56
process: ( ValkeySubscription ) async throws -> sending Value
53
57
) async throws -> Value {
54
58
try await self . subscribe (
@@ -67,11 +71,13 @@ extension ValkeyClient {
67
71
///
68
72
/// - Parameters:
69
73
/// - patterns: list of channel patterns to subscribe to
74
+ /// - isolation: Actor isolation
70
75
/// - process: Closure that is called with subscription async sequence
71
76
/// - Returns: Return value of closure
72
77
@inlinable
73
78
public func psubscribe< Value> (
74
79
to patterns: String ... ,
80
+ isolation: isolated ( any Actor ) ? = #isolation,
75
81
process: ( ValkeySubscription ) async throws -> sending Value
76
82
) async throws -> Value {
77
83
try await self . psubscribe ( to: patterns, process: process)
@@ -86,11 +92,13 @@ extension ValkeyClient {
86
92
///
87
93
/// - Parameters:
88
94
/// - patterns: list of channel patterns to subscribe to
95
+ /// - isolation: Actor isolation
89
96
/// - process: Closure that is called with subscription async sequence
90
97
/// - Returns: Return value of closure
91
98
@inlinable
92
99
public func psubscribe< Value> (
93
100
to patterns: [ String ] ,
101
+ isolation: isolated ( any Actor ) ? = #isolation,
94
102
process: ( ValkeySubscription ) async throws -> sending Value
95
103
) async throws -> Value {
96
104
try await self . subscribe (
@@ -109,11 +117,13 @@ extension ValkeyClient {
109
117
///
110
118
/// - Parameters:
111
119
/// - shardchannels: list of shard channels to subscribe to
120
+ /// - isolation: Actor isolation
112
121
/// - process: Closure that is called with subscription async sequence
113
122
/// - Returns: Return value of closure
114
123
@inlinable
115
124
public func ssubscribe< Value> (
116
125
to shardchannels: String ... ,
126
+ isolation: isolated ( any Actor ) ? = #isolation,
117
127
process: ( ValkeySubscription ) async throws -> sending Value
118
128
) async throws -> Value {
119
129
try await self . ssubscribe ( to: shardchannels, process: process)
@@ -128,11 +138,13 @@ extension ValkeyClient {
128
138
///
129
139
/// - Parameters:
130
140
/// - shardchannels: list of shard channels to subscribe to
141
+ /// - isolation: Actor isolation
131
142
/// - process: Closure that is called with subscription async sequence
132
143
/// - Returns: Return value of closure
133
144
@inlinable
134
145
public func ssubscribe< Value> (
135
146
to shardchannels: [ String ] ,
147
+ isolation: isolated ( any Actor ) ? = #isolation,
136
148
process: ( ValkeySubscription ) async throws -> sending Value
137
149
) async throws -> Value {
138
150
try await self . subscribe (
@@ -152,10 +164,12 @@ extension ValkeyClient {
152
164
/// channel
153
165
///
154
166
/// - Parameters:
167
+ /// - isolation: Actor isolation
155
168
/// - process: Closure that is called with async sequence of key invalidations
156
169
/// - Returns: Return value of closure
157
170
@inlinable
158
171
public func subscribeKeyInvalidations< Value> (
172
+ isolation: isolated ( any Actor ) ? = #isolation,
159
173
process: ( AsyncMapSequence < ValkeySubscription , ValkeyKey > ) async throws -> sending Value
160
174
) async throws -> Value {
161
175
try await self . subscribe ( to: [ ValkeySubscriptions . invalidateChannel] ) { subscription in
0 commit comments