mirror of
https://github.com/Ranchero-Software/NetNewsWire.git
synced 2025-01-30 18:54:53 +01:00
Make block a MainActor block.
This commit is contained in:
parent
0c923a90db
commit
950995688c
@ -11,14 +11,14 @@ import os
|
||||
/// Runs a block of code in the future. Each time `runInFuture` is called, the block is postponed again until the future by `delayInterval`.
|
||||
@MainActor public final class PostponingBlock {
|
||||
|
||||
private let block: () -> Void
|
||||
private let block: @MainActor () -> Void
|
||||
private let delayInterval: TimeInterval
|
||||
private let name: String // For debugging
|
||||
private var timer: Timer?
|
||||
|
||||
private let logger = Logger(subsystem: Bundle.main.bundleIdentifier!, category: "PostponingBlock")
|
||||
|
||||
public init(delayInterval: TimeInterval, name: String, block: @escaping () -> Void) {
|
||||
public init(delayInterval: TimeInterval, name: String, block: @MainActor @escaping () -> Void) {
|
||||
|
||||
self.delayInterval = delayInterval
|
||||
self.name = name
|
||||
|
Loading…
x
Reference in New Issue
Block a user