Over 10 years of community discussion and knowledge are maintained here as a read-only archive.
var myToken:Object = myHTTPService.send();myToken.myOperation= "updateUser";
public function onResult(event:ResultEvent):void{ switch ( event.token.myOperation ) { case 'updateUser': // set the returned data and alert the app data = event.result.user; sendNotification('userUpdated', event.result.user); break; case 'removeUser': // we also kept the old user ID on the token this time sendNotification('userRemoved', event.token.myOperation.removedUserID); break; }}
: var myToken:Object = myHTTPService.send();myToken.myOperation= "updateUser";Isn't this non thread-safe? If the services answers very fast the "myOperation" variable may not have been set.I know it maybe not very probable but should we use a theorically bad pattern?