Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Call the -onCancel:/-onComplete: block immediately when already cancelled/completed #1

robrix opened this Issue Nov 28, 2011 · 0 comments


None yet
1 participant

robrix commented Nov 28, 2011

This will avoid a race condition:

RXFuture *future = [something workWithCompletionHandler:^{ … }];
[future onCancel:^{ … }];

If the future has already been cancelled by the time -onCancel: is called, then the block is never called.

Same thing goes for completion handlers that are added to the future after it’s been returned.

@robrix robrix was assigned Nov 28, 2011

@robrix robrix closed this in 3d97924 Feb 4, 2012

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment