Skip to content
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

I need a help understand the operations dependency in this scenario #115

Open
mohammdsss1 opened this issue Oct 7, 2018 · 0 comments
Open

Comments

@mohammdsss1
Copy link

I need to maintain the value updates of one variable across my app, so let's assume I have this variable called number of type Int.

I created an operation called SerialOperation which responsible for incrementing number by one, the other operation called DataPrepOperation will wait (dependency on SerialOperation) for that operation to finish in order to use it. I also created PSBlockOperation that works as an adapter to ensure the transferring of that value between these two operations.

This design of operations was inspired by this post here.

My problem is that the operation called DataPrepOperation is always having the wrong value, for example: if I created three SerialOperation and another three DataPrepOperation then all DataPrepOperation will have the same last value. I don't understand what is the case here.

I attached the project for more.
AdapterOperation.zip

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant