mirror of
https://github.com/maxgoedjen/secretive.git
synced 2025-12-14 21:10:56 +00:00
Try async and mainactor inner dispatch
This commit is contained in:
parent
3a9d18e667
commit
df26e0047c
@ -116,15 +116,19 @@ extension SocketController {
|
|||||||
private extension FileHandle {
|
private extension FileHandle {
|
||||||
|
|
||||||
/// Ensures waitForDataInBackgroundAndNotify will be called on the main actor.
|
/// Ensures waitForDataInBackgroundAndNotify will be called on the main actor.
|
||||||
@MainActor func waitForDataInBackgroundAndNotifyOnMainActor() async {
|
func waitForDataInBackgroundAndNotifyOnMainActor() async {
|
||||||
waitForDataInBackgroundAndNotify()
|
await MainActor.run {
|
||||||
|
waitForDataInBackgroundAndNotify()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/// Ensures acceptConnectionInBackgroundAndNotify will be called on the main actor.
|
/// Ensures acceptConnectionInBackgroundAndNotify will be called on the main actor.
|
||||||
/// - Parameter modes: the runloop modes to use.
|
/// - Parameter modes: the runloop modes to use.
|
||||||
@MainActor func acceptConnectionInBackgroundAndNotifyOnMainActor(forModes modes: [RunLoop.Mode]? = [RunLoop.Mode.default]) async {
|
func acceptConnectionInBackgroundAndNotifyOnMainActor(forModes modes: [RunLoop.Mode]? = [RunLoop.Mode.default]) async {
|
||||||
acceptConnectionInBackgroundAndNotify(forModes: modes)
|
await MainActor.run {
|
||||||
|
acceptConnectionInBackgroundAndNotify(forModes: modes)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user