Skip to content

Instantly share code, notes, and snippets.

@mischa-hildebrand
mischa-hildebrand / QueueHandler.swift
Last active September 5, 2017 16:35 — forked from kayoslab/QueueHandler.swift
A simple Generic Queue with different priority Levels
import Foundation
/// Subclass this Class with a non generic Type.
/// - note: Please override the init function with a private
/// access modifactor and create a singleton, so you
/// can ensure that there are no more Queues as you
/// are expecting.
internal class QueueHandler<T> {
private var queues: Set<Queue<T>>
/// Checks if any Queue contains an Element waiting for execution.