Files
letro-ios/ElementX/Sources/Services/Background/BackgroundTaskServiceProtocol.swift
ismailgulek d89cefa253 Background execution (#100)
* #99 Implement background tasks

* #99 Add changelog

* #99 Fix some code smells

* #99 Use background tasks in room timeline controller

* #99 Move background task service into room proxy and media provider
2022-06-29 13:03:28 +03:00

41 lines
1.3 KiB
Swift

//
// BackgroundTaskServiceProtocol.swift
// ElementX
//
// Created by Ismail on 28.06.2022.
// Copyright © 2022 Element. All rights reserved.
//
import Foundation
protocol BackgroundTaskServiceProtocol {
func startBackgroundTask(withName name: String,
isReusable: Bool,
expirationHandler: (() -> Void)?) -> BackgroundTaskProtocol?
}
extension BackgroundTaskServiceProtocol {
func startBackgroundTask(withName name: String) -> BackgroundTaskProtocol? {
return startBackgroundTask(withName: name,
expirationHandler: nil)
}
func startBackgroundTask(withName name: String,
isReusable: Bool) -> BackgroundTaskProtocol? {
return startBackgroundTask(withName: name,
isReusable: isReusable,
expirationHandler: nil)
}
func startBackgroundTask(withName name: String,
expirationHandler: (() -> Void)?) -> BackgroundTaskProtocol? {
return startBackgroundTask(withName: name,
isReusable: false,
expirationHandler: expirationHandler)
}
}