In Objective-C I use a Notification to do some tasks, which required some time to process. I can listen to the Notification, until it is ready…
For example:
[[NSNotificationCenter defaultCenter] addObserver:objectB
selector:@selector(objectReceived:)
name:@"objectATasks"
object:nil];
[objectA doALongProcess];
When the objectA is finished the task, the @”objectATasks” will be fired, and the objectB’s objectReceived: will be called. Do have have similar things / concept in java? Thank
You can make use of the Observer design pattern in java