RBCancellableBlockTask Class Reference

Inherits from NSObject
Conforms to RBCancellableTask
Declared in RBThreading.h

Overview

A task that executes a block and allows cancellation before execution.

  taskBlock

The block to be executed.

@property (nonatomic, readonly, nonnull) dispatch_block_t taskBlock

Declared In

RBThreading.h

  cancelled

Whether the task has been cancelled.

@property (nonatomic, readonly) BOOL cancelled

Declared In

RBThreading.h

  started

Whether the task has been started.

@property (nonatomic, readonly) BOOL started

Declared In

RBThreading.h

  finished

Whether the task has been completed.

@property (nonatomic, readonly) BOOL finished

Declared In

RBThreading.h

– initWithTaskBlock:

Initializes a new task with the given block.

- (nonnull instancetype)initWithTaskBlock:(nonnull dispatch_block_t)taskBlock

Parameters

taskBlock

The block to execute.

Return Value

The initialized object.

Declared In

RBThreading.h

– start

Starts the task by executing the block.

- (BOOL)start

Return Value

Whether the task was started successfully.

Declared In

RBThreading.h