@@ -81,7 +81,6 @@ public struct LambdaContext: CustomDebugStringConvertible, Sendable {
81
81
let logger : Logger
82
82
let eventLoop : EventLoop
83
83
let allocator : ByteBufferAllocator
84
- let tasks : DetachedTasksContainer
85
84
86
85
init (
87
86
requestID: String ,
@@ -92,8 +91,7 @@ public struct LambdaContext: CustomDebugStringConvertible, Sendable {
92
91
clientContext: String ? ,
93
92
logger: Logger ,
94
93
eventLoop: EventLoop ,
95
- allocator: ByteBufferAllocator ,
96
- tasks: DetachedTasksContainer
94
+ allocator: ByteBufferAllocator
97
95
) {
98
96
self . requestID = requestID
99
97
self . traceID = traceID
@@ -104,7 +102,6 @@ public struct LambdaContext: CustomDebugStringConvertible, Sendable {
104
102
self . logger = logger
105
103
self . eventLoop = eventLoop
106
104
self . allocator = allocator
107
- self . tasks = tasks
108
105
}
109
106
}
110
107
@@ -182,13 +179,7 @@ public struct LambdaContext: CustomDebugStringConvertible, Sendable {
182
179
clientContext: clientContext,
183
180
logger: logger,
184
181
eventLoop: eventLoop,
185
- allocator: allocator,
186
- tasks: DetachedTasksContainer (
187
- context: DetachedTasksContainer . Context (
188
- eventLoop: eventLoop,
189
- logger: logger
190
- )
191
- )
182
+ allocator: allocator
192
183
)
193
184
}
194
185
@@ -200,22 +191,6 @@ public struct LambdaContext: CustomDebugStringConvertible, Sendable {
200
191
return . milliseconds( remaining)
201
192
}
202
193
203
- var tasks : DetachedTasksContainer {
204
- self . storage. tasks
205
- }
206
-
207
- /// Registers a background task that continues running after the synchronous invocation has completed.
208
- /// This is useful for tasks like flushing metrics or performing clean-up operations without delaying the response.
209
- ///
210
- /// - Parameter body: An asynchronous closure that performs the background task.
211
- /// - Warning: You will be billed for the milliseconds of Lambda execution time until the very last
212
- /// background task is finished.
213
- public func detachedBackgroundTask( _ body: @escaping @Sendable ( ) async -> Void ) {
214
- Task {
215
- await self . tasks. detached ( task: body)
216
- }
217
- }
218
-
219
194
public var debugDescription : String {
220
195
" \( Self . self) (requestID: \( self . requestID) , traceID: \( self . traceID) , invokedFunctionARN: \( self . invokedFunctionARN) , cognitoIdentity: \( self . cognitoIdentity ?? " nil " ) , clientContext: \( self . clientContext ?? " nil " ) , deadline: \( self . deadline) ) "
221
196
}
0 commit comments