We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c8e9952 commit 8f61d72Copy full SHA for 8f61d72
Sources/LifecycleNIOCompat/Bridge.swift
@@ -46,3 +46,22 @@ extension LifecycleHandler {
46
}
47
48
49
+
50
+extension ServiceLifecycle {
51
+ /// Starts the provided `LifecycleItem` array.
52
+ /// Startup is performed in the order of items provided.
53
+ ///
54
+ /// - parameters:
55
+ /// - eventLoop: The `eventLoop` which is used to generate the `EventLoopFuture` that is returned. After the start the future is fulfilled:
56
+ func start(on eventLoop: EventLoop) -> EventLoopFuture<Void> {
57
+ let promise = eventLoop.makePromise(of: Void.self)
58
+ self.start { error in
59
+ if let error = error {
60
+ promise.fail(error)
61
+ } else {
62
+ promise.succeed(())
63
+ }
64
65
+ return promise.futureResult
66
67
+}
0 commit comments