BBM Enterprise iOS SDK  R3
ObservableMonitor Class Reference
Inheritance diagram for ObservableMonitor:

Instance Methods

(id) - initWithName:block:
 
(id) - initWithName:selfTerminatingBlock:
 
(void) - activate
 
(void) - deActivate
 

Class Methods

(ObservableMonitor *) + monitorActivatedWithName:block:
 
(ObservableMonitor *) + monitorActivatedWithName:selfTerminatingBlock:
 

Properties

BOOL limitFrequency
 

Detailed Description

An instance of this class will execute a given block and track any calls to getterCalledForObject:propertyName in ObservableTracker. It will add a KVO observer for those properties and will execute the block every time any of the tracked values changes.

Since
R3

Method Documentation

◆ activate()

- (void) activate

Activates the monitor.

Since
R3

◆ deActivate()

- (void) deActivate

Deactivates the monitor.

Since
R3

◆ initWithName:block:()

- (id) initWithName: (NSString *)  name
block: (void(^)())  executionBlock 

Creates a new monitor with the given name and executionBlock.

Parameters
nameThe name of the monitor. This is only used for debugging purposes.
executionBlockThe block of code to execute and monitor for observables.
Since
R3

◆ initWithName:selfTerminatingBlock:()

- (id) initWithName: (NSString *)  name
selfTerminatingBlock: (BOOL(^)())  executionBlock 

Creates a new self-terminating monitor with the given name and executionBlock. The execution block should return YES to stop execution of the monitor.

Parameters
nameThe name of the monitor. This is only used for debugging purposes.
executionBlockThe block of code to execute and monitor for observables.
Since
R3

◆ monitorActivatedWithName:block:()

+ (ObservableMonitor*) monitorActivatedWithName: (NSString *)  name
block: (void(^)())  executeBlock 

Creates a monitor that is already activated so it will run every time an observable in the block changes.

Parameters
nameThe name of the monitor. This is only used for debugging purposes.
executeBlockThe block that will be executed when the monitor runs.
Returns
ObservableMonitor The monitor that was created.
Since
R3

◆ monitorActivatedWithName:selfTerminatingBlock:()

+ (ObservableMonitor*) monitorActivatedWithName: (NSString *)  name
selfTerminatingBlock: (BOOL(^)())  executeBlock 

Creates a monitor that is already activated so it will run every time an observable in the block changes. If the block return YES the monitor will be terminated. If the block returns NO it will continue to be active.

Parameters
nameThe name of the monitor. This is only used for debugging purposes.
executeBlockThe block that will be executed when the monitor runs. The monitor will run until this block returns YES;
Returns
ObservableMonitor The monitor that was created.
Since
R3

Property Documentation

◆ limitFrequency

- (BOOL) limitFrequency
readwriteatomicassign

When set, the monitor will wait for 3 seconds between runs. This should be turned on when a monitor will be triggered often enough that the main thread could be blocked.

Since
R3