-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Nikhil Nigade <[email protected]>
- Loading branch information
1 parent
a8532ce
commit b6a9e2b
Showing
7 changed files
with
61 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
32 changes: 32 additions & 0 deletions
32
Sources/DZNetworking/Utilities/DZConcurrencyUtilities.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
// | ||
// DZConcurrencyUtilities.swift | ||
// Networking | ||
// | ||
// Created by Nikhil Nigade on 09/07/24. | ||
// | ||
|
||
import Foundation | ||
|
||
internal struct SendableBox<T>: @unchecked Sendable { | ||
let wrappedValue: T | ||
|
||
init(_ wrappedValue: T) { | ||
self.wrappedValue = wrappedValue | ||
} | ||
|
||
func get() -> T { | ||
wrappedValue | ||
} | ||
} | ||
|
||
internal struct SendableHashableBox<T: Hashable>: @unchecked Sendable { | ||
let wrappedValue: T | ||
|
||
init(_ wrappedValue: T) { | ||
self.wrappedValue = wrappedValue | ||
} | ||
|
||
func get() -> T { | ||
wrappedValue | ||
} | ||
} |