 	/// Optionally returns a disposable that can be used to cancel the work
 	/// before it begins.
 	func schedule(action: () -> ()) -> Disposable?
+
+	/// Schedules an action for execution at or after the given date.
+	///
+	/// Optionally returns a disposable that can be used to cancel the work
+	/// before it begins.
+	func scheduleAfter(date: NSDate, action: () -> ()) -> Disposable?
+}
+
+/// A particular kind of scheduler that supports repeating actions.
+protocol RepeatableScheduler: Scheduler {
+	/// Schedules a recurring action at the given interval, beginning at the
+	/// given start time.
+	///
+	/// Optionally returns a disposable that can be used to cancel the work
+	/// before it begins.
+	func scheduleAfter(date: NSDate, repeatingEvery: NSTimeInterval, withLeeway: NSTimeInterval, action: () -> ()) -> Disposable?
 }
 
 let currentSchedulerKey = "RxSwiftCurrentSchedulerKey"

				return
			}
			
			_asCurrentScheduler(self, work)
		})
		
		return d
	}
}

		action()
		return nil
	}

	func scheduleAfter(date: NSDate, action: () -> ()) -> Disposable? {
		NSThread.sleepUntilDate(date)
		return schedule(action)
	}
}

/// A scheduler that performs all work on the main thread.
struct MainScheduler: RepeatableScheduler {
	let _innerScheduler = QueueScheduler(dispatch_get_main_queue())

	func schedule(action: () -> ()) -> Disposable? {
		return _innerScheduler.schedule(action)
	}

	func scheduleAfter(date: NSDate, action: () -> ()) -> Disposable? {
		return _innerScheduler.scheduleAfter(date, action: action)
	}

	func scheduleAfter(date: NSDate, repeatingEvery: NSTimeInterval, withLeeway: NSTimeInterval, action: () -> ()) -> Disposable? {
		return _innerScheduler.scheduleAfter(date, repeatingEvery: repeatingEvery, withLeeway: withLeeway, action: action)
	}
}

