RACScheduler+Subclass.h 986 B

123456789101112131415161718192021222324252627282930313233
  1. //
  2. // RACScheduler.m
  3. // ReactiveObjC
  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. NS_ASSUME_NONNULL_BEGIN
  11. /// An interface for use by subclasses.
  12. ///
  13. /// Subclasses should use `-performAsCurrentScheduler:` to do the actual block
  14. /// invocation so that +[RACScheduler currentScheduler] behaves as expected.
  15. ///
  16. /// **Note that RACSchedulers are expected to be serial**. Subclasses must honor
  17. /// that contract. See `RACTargetQueueScheduler` for a queue-based scheduler
  18. /// which will enforce the serialization guarantee.
  19. @interface RACScheduler ()
  20. /// Performs the given block with the receiver as the current scheduler for
  21. /// its thread. This should only be called by subclasses to perform their
  22. /// scheduled blocks.
  23. ///
  24. /// block - The block to execute. Cannot be NULL.
  25. - (void)performAsCurrentScheduler:(void (^)(void))block;
  26. @end
  27. NS_ASSUME_NONNULL_END