mirror of
https://github.com/HaishinKit/HaishinKit.swift.git
synced 2026-05-07 20:12:28 +00:00
22 lines
621 B
Swift
22 lines
621 B
Swift
import Foundation
|
|
|
|
/// A type that methods for running.
|
|
public protocol Runner: AnyObject {
|
|
/// Indicates whether the receiver is running.
|
|
var isRunning: Bool { get }
|
|
/// Tells the receiver to start running.
|
|
func startRunning()
|
|
/// Tells the receiver to stop running.
|
|
func stopRunning()
|
|
}
|
|
|
|
/// A type that methods for running.
|
|
public protocol AsyncRunner: Actor {
|
|
/// Indicates whether the receiver is running.
|
|
var isRunning: Bool { get }
|
|
/// Tells the receiver to start running.
|
|
func startRunning() async
|
|
/// Tells the receiver to stop running.
|
|
func stopRunning() async
|
|
}
|