mirror of
https://github.com/hyperoslo/Cache.git
synced 2026-04-07 19:17:36 +00:00
Allow queue to be passed
This commit is contained in:
@@ -4,10 +4,11 @@ import Foundation
|
||||
/// The completion closure will be called when operation completes.
|
||||
public class AsyncStorage {
|
||||
let internalStorage: StorageAware
|
||||
public let serialQueue = DispatchQueue(label: "Cache.AsyncStorage.Queue")
|
||||
public let serialQueue: DispatchQueue
|
||||
|
||||
init(storage: StorageAware) {
|
||||
init(storage: StorageAware, serialQueue: DispatchQueue) {
|
||||
self.internalStorage = storage
|
||||
self.serialQueue = serialQueue
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -4,10 +4,11 @@ import Foundation
|
||||
/// Block the current queue until the operation completes.
|
||||
public class SyncStorage {
|
||||
let internalStorage: StorageAware
|
||||
fileprivate let serialQueue = DispatchQueue(label: "Cache.SyncStorage.Queue")
|
||||
fileprivate let serialQueue: DispatchQueue
|
||||
|
||||
init(storage: StorageAware) {
|
||||
init(storage: StorageAware, serialQueue: DispatchQueue) {
|
||||
self.internalStorage = storage
|
||||
self.serialQueue = serialQueue
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user