Skip to content
This repository has been archived by the owner on Nov 15, 2024. It is now read-only.

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 subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant