     return Executor.queue(DispatchQueue.global(qos: qos))
   }
 }
+
+/// **internal use only**
+protocol ExecutorImpl {
+  func fc_execute(_ block: @escaping (Void) -> Void)
+  func fc_execute(after timeout: Double, _ block: @escaping (Void) -> Void)
+}
+
+extension DispatchQueue : ExecutorImpl {
+  func fc_execute(_ block: @escaping (Void) -> Void) {
+    self.async(execute: block)
+  }
+
+  func fc_execute(after timeout: Double, _ block: @escaping (Void) -> Void) {
+    let wallDeadline = DispatchWallTime.now() + .nanoseconds(Int(timeout * 1000 * 1000 * 1000))
+    self.asyncAfter(wallDeadline: wallDeadline, execute: block)
+  }
+}
+
+final class HandlerBasedExecutorImpl : ExecutorImpl {
+  public typealias Handler = (@escaping (Void) -> Void) -> Void
+  private let _handler: Handler
+
+  init(handler: @escaping Handler) {
+    _handler = handler
+  }
+
+  func fc_execute(_ block: @escaping (Void) -> Void) {
+    _handler(block)
+  }
+
+  func fc_execute(after timeout: Double, _ block: @escaping (Void) -> Void) {
+    let deadline = DispatchWallTime.now() + .nanoseconds(Int(timeout * 1000 * 1000 * 1000))
+    DispatchQueue.global(qos: .default).asyncAfter(wallDeadline: deadline) {
+      self.fc_execute(block)
+    }
+  }
+}

/// Executor encapsulates asynchrounous way of execution escaped block.
public struct Executor {
  public typealias Handler = (@escaping (Void) -> Void) -> Void
  private let _handler: Handler

  /// Initialiaes executor with custom handler
  public init(handler: @escaping Handler) {
    _handler = handler
  }

  func execute(_ block: @escaping (Void) -> Void) {
    _handler(block)
  }

  func execute(after timeout: Double, _ block: @escaping (Void) -> Void) {
    let deadline = DispatchWallTime.now() + .nanoseconds(Int(timeout * 1000 * 1000 * 1000))
    DispatchQueue.global(qos: .default).asyncAfter(wallDeadline: deadline) {
      self.execute(block)
    }
  }
}



  /// initializes executor based on specified queue
  static func queue(_ queue: DispatchQueue) -> Executor {
    return Executor(impl: queue)
  }

  /// initializes executor based on global queue with specified QoS class
