LifecycleTasksContainer
public protocol LifecycleTasksContainer
A container of LifecycleTask, used to register additional LifecycleTask
-
register(_:Default implementation) Adds a
LifecycleTaskto aLifecycleTaskscollection.Default Implementation
Adds a
LifecycleTaskto aLifecycleTaskscollection.Declaration
Swift
func register(_ tasks: [LifecycleTask])Parameters
tasksarray of
LifecycleTask.
-
register(label:Extension methodstart: shutdown: shutdownIfNotStarted: ) Adds a
LifecycleTaskto aLifecycleTaskscollection.Declaration
Swift
public func register(label: String, start: LifecycleHandler, shutdown: LifecycleHandler, shutdownIfNotStarted: Bool? = nil)Parameters
labellabel of the item, useful for debugging.
startHandlerto perform the startup.shutdownHandlerto perform the shutdown. -
registerShutdown(label:Extension method_: ) Adds a
LifecycleTaskto aLifecycleTaskscollection.Declaration
Swift
public func registerShutdown(label: String, _ handler: LifecycleHandler)Parameters
labellabel of the item, useful for debugging.
handlerHandlerto perform the shutdown. -
registerStateful(label:Extension methodstart: shutdown: ) Add a stateful
LifecycleTaskto aLifecycleTaskscollection.Declaration
Swift
public func registerStateful<State>(label: String, start: LifecycleStartHandler<State>, shutdown: LifecycleShutdownHandler<State>)Parameters
labellabel of the item, useful for debugging.
startLifecycleStartHandlerto perform the startup and return the state.shutdownLifecycleShutdownHandlerto perform the shutdown given the state.
View on GitHub
Install in Dash
LifecycleTasksContainer Protocol Reference