I have a situation where I'm starting a number of objects that, when they are ready to handle some input data, call a handler.
That handler gets a dataset from an ArrayCollection of pending requests, assigns it to the object, and removes the dataset from the ArrayCollection.
(I can't pop from the ArrayCollection because I need to search through it to find an appropriate dataset - it isn't always the one on top.)
Is it possible that two objects could call my handler in such a way that (1) the first is assigned a dataset, (2) the second is assigned the same dataset before the instance of the handler servicing the first has deleted it and I guess (3) the second instance of the handler errors on trying to delete the dataset from the ArrayCollection.
I'm not familiar enough with the Flash Player runtime to know if this failure scenario is even possible, or if I should take the extra time to put some sort of locking in place to prevent it.
Edit: The answers so far give glowing reviews for Flex, but I'm not sure they answer the question. To be clear, I'm not trying to decide whether or not to use Flex.
If I have a method that:
- Gets a piece of data from somewhere in an ArrayCollection
- Does something with that data
- Removes that data from the ArrayCollection
Is it possible that another invocation of that same method could do #1 after the first invocation does #1 but before it does #3?
le dorfier, you said that Flex/AS "just works" - can you clarify that it will "just work" in this case?