|
15 | 15 | extension EventLoopFuture {
|
16 | 16 | @inlinable
|
17 | 17 | @available(*, deprecated, message: "Please don't pass file:line:, there's no point.")
|
18 |
| - public func flatMap<NewValue>(file: StaticString = #fileID, line: UInt = #line, _ callback: @escaping (Value) -> EventLoopFuture<NewValue>) -> EventLoopFuture<NewValue> { |
| 18 | + public func flatMap<NewValue: Sendable>( |
| 19 | + file: StaticString = #fileID, |
| 20 | + line: UInt = #line, |
| 21 | + _ callback: @escaping @Sendable (Value) -> EventLoopFuture<NewValue> |
| 22 | + ) -> EventLoopFuture<NewValue> { |
19 | 23 | return self.flatMap(callback)
|
20 | 24 | }
|
21 | 25 |
|
22 | 26 | @inlinable
|
23 | 27 | @available(*, deprecated, message: "Please don't pass file:line:, there's no point.")
|
24 |
| - public func flatMapThrowing<NewValue>(file: StaticString = #fileID, |
25 |
| - line: UInt = #line, |
26 |
| - _ callback: @escaping (Value) throws -> NewValue) -> EventLoopFuture<NewValue> { |
| 28 | + public func flatMapThrowing<NewValue: Sendable>( |
| 29 | + file: StaticString = #fileID, |
| 30 | + line: UInt = #line, |
| 31 | + _ callback: @escaping @Sendable (Value) throws -> NewValue |
| 32 | + ) -> EventLoopFuture<NewValue> { |
27 | 33 | return self.flatMapThrowing(callback)
|
28 | 34 | }
|
29 | 35 |
|
30 | 36 | @inlinable
|
31 | 37 | @available(*, deprecated, message: "Please don't pass file:line:, there's no point.")
|
32 |
| - public func flatMapErrorThrowing(file: StaticString = #fileID, line: UInt = #line, _ callback: @escaping (Error) throws -> Value) -> EventLoopFuture<Value> { |
| 38 | + public func flatMapErrorThrowing( |
| 39 | + file: StaticString = #fileID, |
| 40 | + line: UInt = #line, |
| 41 | + _ callback: @escaping @Sendable (Error) throws -> Value |
| 42 | + ) -> EventLoopFuture<Value> { |
33 | 43 | return self.flatMapErrorThrowing(callback)
|
34 | 44 | }
|
35 | 45 |
|
36 | 46 | @inlinable
|
37 | 47 | @available(*, deprecated, message: "Please don't pass file:line:, there's no point.")
|
38 |
| - public func map<NewValue>(file: StaticString = #fileID, line: UInt = #line, _ callback: @escaping (Value) -> (NewValue)) -> EventLoopFuture<NewValue> { |
| 48 | + public func map<NewValue>( |
| 49 | + file: StaticString = #fileID, |
| 50 | + line: UInt = #line, |
| 51 | + _ callback: @escaping @Sendable (Value) -> (NewValue) |
| 52 | + ) -> EventLoopFuture<NewValue> { |
39 | 53 | return self.map(callback)
|
40 | 54 | }
|
41 | 55 |
|
42 | 56 | @inlinable
|
43 | 57 | @available(*, deprecated, message: "Please don't pass file:line:, there's no point.")
|
44 |
| - public func flatMapError(file: StaticString = #fileID, line: UInt = #line, _ callback: @escaping (Error) -> EventLoopFuture<Value>) -> EventLoopFuture<Value> { |
| 58 | + public func flatMapError( |
| 59 | + file: StaticString = #fileID, |
| 60 | + line: UInt = #line, |
| 61 | + _ callback: @escaping @Sendable (Error) -> EventLoopFuture<Value> |
| 62 | + ) -> EventLoopFuture<Value> where Value: Sendable { |
45 | 63 | return self.flatMapError(callback)
|
46 | 64 | }
|
47 | 65 |
|
48 | 66 | @inlinable
|
49 | 67 | @available(*, deprecated, message: "Please don't pass file:line:, there's no point.")
|
50 |
| - public func flatMapResult<NewValue, SomeError: Error>(file: StaticString = #fileID, |
51 |
| - line: UInt = #line, |
52 |
| - _ body: @escaping (Value) -> Result<NewValue, SomeError>) -> EventLoopFuture<NewValue> { |
| 68 | + public func flatMapResult<NewValue, SomeError: Error>( |
| 69 | + file: StaticString = #fileID, |
| 70 | + line: UInt = #line, |
| 71 | + _ body: @escaping @Sendable (Value) -> Result<NewValue, SomeError> |
| 72 | + ) -> EventLoopFuture<NewValue> { |
53 | 73 | return self.flatMapResult(body)
|
54 | 74 | }
|
55 | 75 |
|
56 | 76 | @inlinable
|
57 | 77 | @available(*, deprecated, message: "Please don't pass file:line:, there's no point.")
|
58 |
| - public func recover(file: StaticString = #fileID, line: UInt = #line, _ callback: @escaping (Error) -> Value) -> EventLoopFuture<Value> { |
| 78 | + public func recover( |
| 79 | + file: StaticString = #fileID, |
| 80 | + line: UInt = #line, |
| 81 | + _ callback: @escaping @Sendable (Error) -> Value |
| 82 | + ) -> EventLoopFuture<Value> { |
59 | 83 | return self.recover(callback)
|
60 | 84 | }
|
61 | 85 |
|
62 | 86 | @inlinable
|
63 | 87 | @available(*, deprecated, message: "Please don't pass file:line:, there's no point.")
|
64 |
| - public func and<OtherValue>(_ other: EventLoopFuture<OtherValue>, |
65 |
| - file: StaticString = #fileID, |
66 |
| - line: UInt = #line) -> EventLoopFuture<(Value, OtherValue)> { |
| 88 | + public func and<OtherValue: Sendable>( |
| 89 | + _ other: EventLoopFuture<OtherValue>, |
| 90 | + file: StaticString = #fileID, |
| 91 | + line: UInt = #line |
| 92 | + ) -> EventLoopFuture<(Value, OtherValue)> { |
67 | 93 | return self.and(other)
|
68 | 94 | }
|
69 | 95 |
|
70 | 96 | @inlinable
|
71 | 97 | @available(*, deprecated, message: "Please don't pass file:line:, there's no point.")
|
72 |
| - public func and<OtherValue>(value: OtherValue, |
73 |
| - file: StaticString = #fileID, |
74 |
| - line: UInt = #line) -> EventLoopFuture<(Value, OtherValue)> { |
| 98 | + public func and<OtherValue: Sendable>( |
| 99 | + value: OtherValue, |
| 100 | + file: StaticString = #fileID, |
| 101 | + line: UInt = #line |
| 102 | + ) -> EventLoopFuture<(Value, OtherValue)> { |
75 | 103 | return self.and(value: value)
|
76 | 104 | }
|
77 | 105 | }
|
0 commit comments