google / google/promises

How to block until promise completes?

Open
#178 3 comments 0 reactions 0 assignees View on GitHub
Dominant language
Objective-C
Stars
3.8k
Forks
316
PR merge metrics
No merged PRs in 30d

Description

I have a use case that needs to use Promises, but the old calling code is synchronous. In Swift, is there a way to block the synchronous caller to wait for the promise to finish? I don't think I can use a custom dispatch queue since it needs to execute on the main thread.

Callback methods unfortunately do not work since the promise needs to start and complete at the middle of a long chain of synchronous commands.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.