Skip to content

Commit ddc544b

Browse files
committed
Add public initializer with queue and change default queue label
1 parent 617d875 commit ddc544b

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

Sources/Shouter/Shouter.swift

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,11 @@ public class Shouter {
1414

1515
fileprivate typealias Key = String
1616
fileprivate var observers: [Key: NSHashTable<AnyObject>] = [:]
17-
fileprivate let notificationQueue = DispatchQueue(label: "com.swift.notification.center.dispatch.queue", attributes: .concurrent)
17+
fileprivate let notificationQueue: DispatchQueue
18+
19+
public init(notificationQueue: DispatchQueue = DispatchQueue(label: "de.chaosspace.Shouter.dispatch.queue", attributes: .concurrent)) {
20+
self.notificationQueue = notificationQueue
21+
}
1822

1923
public func register<T>(_ type: T.Type, observer: T) {
2024
notificationQueue.sync(flags: .barrier) {

0 commit comments

Comments
 (0)