-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Closed
Description
One of the things that Bolts does pretty well is let you choose a queue to run a block on, while this is manual with PromiseKit. I think it'd be useful to be able to write:
dispatch_queue_t queue = ...;
dispatch_promise(queue, ^{
return [self makeValueAsync];
}).then(dispatch_get_main_queue(), ^(id value) {
[self.view displayValue:value];
return [self logDisplayInfo:self.view];
}).then(^{
// No queue specified: synchronously run on the same queue immediately after
// logDisplayInfo's promise is resolved
});
Also Bolts has an "executor" abstraction that runs blocks. Executors might be more general than needed but the default executors are useful to have:
- dispatch_async to the main queue
- dispatch_async to the default-pri background queue
- run synchronously on the current queue where the previous task finished
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels