cancel
Showing results for 
Search instead for 
Did you mean: 
Announcements
Update: Find information on Dropbox support during COVID-19 here
Close
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted

Specify the dispatch queue.

New member | Level 1
New member | Level 1

Here is what I am doing:

let ds = dispatch_semaphore_create(0)

client.file.download(......

......

dispatch_semaphore_signal(ds)

}

dispatch_semaphore_wait(ds, DISPATCH_TIME_FOREVER)

I am doing this to wait for the results of the download before proceeding. But, this does not work because it seems the asynchronous call is run on the main queue. So, I block the very call I am waiting on.

 

Here is my question.

Is there a way to specify the dispatch queue on which the asynchronous operation runs.

 

 

4 Replies 4
Highlighted

Re: Specify the dispatch queue.

Super User II
Super User II

Moved to the API forum.

Highlighted

Re: Specify the dispatch queue.

Dropboxer
Dropboxer

SwiftyDropbox doesn't currently offer the ability to specify what queue to run this on, but I'll be sure to pass this along as a feature request.

Highlighted

Re: Specify the dispatch queue.

Dropboxer
Dropboxer

@dennis s.: I know this thread is quite old now (two months), but we're finally looking at implementing this functionality now.

However, we're curious to learn more about your use case. Is there any reason that you can't put the subsequent code to be executed in the `download` response handler closure? Is it simply a matter of style to avoid unnecessary nesting?

Highlighted

Re: Specify the dispatch queue.

Dropboxer
Dropboxer

Work Smarter with Dropbox

The way we work is changing. Share and discover new ways to work smarter with Dropbox in our community.

Sound good? Let's get started.
Who's talking

Top contributors to this post

What do Dropbox user levels mean?
Need more support?