-
Notifications
You must be signed in to change notification settings - Fork 317
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Chaining does not seem to be working #120
Comments
You don’t store the result if getVersion to versionarray.
… On 16 Jul 2017, at 09.08, martheli ***@***.***> wrote:
My code is as follows:
let backgroundBlock = Async.utility {
for serial in serialarray
{
self.getVersion(serial: serial)
}
}
backgroundBlock.main
{
print (serialarray)
print (versionarray)
SwiftSpinner.hide()
}
If I understand this right, getVersion should run in the background until it completes fully and then the second block should run and print out both of my arrays. Instead the first array gets printed but the second array comes up blank. I added a print inside of my getVersion function to see if it was working and I can see all the values being populated so it looks like the block is not waiting to complete before it prints the array out. Am I doing something wrong?
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or mute the thread.
|
@duemunk I added the getVersion function to my original post. Versionarray gets populated in the getVersion function. I also tried the following:
Both prints are executing before getVersion finishes its loop to populate the array. |
This is not an issue for Async. Please refer to GCD documentation and/or StackOverflow. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
My code is as follows:
If I understand this right, getVersion should run in the background until it completes fully and then the second block should run and print out both of my arrays. Instead the first array gets printed but the second array comes up blank. I added a print inside of my getVersion function to see if it was working and I can see all the values being populated so it looks like the block is not waiting to complete before it prints the array out. Am I doing something wrong?��
The getVersion function is as follows:
The text was updated successfully, but these errors were encountered: