RACScheduler+Subclass.h 939 B

123456789101112131415161718192021222324252627282930
  1. //
  2. // RACScheduler.m
  3. // ReactiveCocoa
  4. //
  5. // Created by Miķelis Vindavs on 5/27/14.
  6. // Copyright (c) 2014 GitHub, Inc. All rights reserved.
  7. //
  8. #import <Foundation/Foundation.h>
  9. #import "RACScheduler.h"
  10. /// An interface for use by subclasses.
  11. ///
  12. /// Subclasses should use `-performAsCurrentScheduler:` to do the actual block
  13. /// invocation so that +[RACScheduler currentScheduler] behaves as expected.
  14. ///
  15. /// **Note that RACSchedulers are expected to be serial**. Subclasses must honor
  16. /// that contract. See `RACTargetQueueScheduler` for a queue-based scheduler
  17. /// which will enforce the serialization guarantee.
  18. @interface RACScheduler ()
  19. /// Performs the given block with the receiver as the current scheduler for
  20. /// its thread. This should only be called by subclasses to perform their
  21. /// scheduled blocks.
  22. ///
  23. /// block - The block to execute. Cannot be NULL.
  24. - (void)performAsCurrentScheduler:(void (^)(void))block;
  25. @end