File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -104,7 +104,7 @@ public struct LifecycleHandler {
104
104
extension LifecycleHandler {
105
105
public init ( _ handler: @escaping ( ) async throws -> Void ) {
106
106
self = LifecycleHandler { callback in
107
- detach {
107
+ Task {
108
108
do {
109
109
try await handler ( )
110
110
callback ( nil )
@@ -168,7 +168,7 @@ public struct LifecycleStartHandler<State> {
168
168
extension LifecycleStartHandler {
169
169
public init ( _ handler: @escaping ( ) async throws -> State ) {
170
170
self = LifecycleStartHandler { callback in
171
- detach {
171
+ Task {
172
172
do {
173
173
let state = try await handler ( )
174
174
callback ( . success( state) )
@@ -230,7 +230,7 @@ public struct LifecycleShutdownHandler<State> {
230
230
extension LifecycleShutdownHandler {
231
231
public init ( _ handler: @escaping ( State ) async throws -> Void ) {
232
232
self = LifecycleShutdownHandler { state, callback in
233
- detach {
233
+ Task {
234
234
do {
235
235
try await handler ( state)
236
236
callback ( nil )
You can’t perform that action at this time.
0 commit comments