Return-Path: X-Original-To: apmail-incubator-flex-dev-archive@minotaur.apache.org Delivered-To: apmail-incubator-flex-dev-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id DDD119961 for ; Mon, 26 Mar 2012 07:42:02 +0000 (UTC) Received: (qmail 11673 invoked by uid 500); 26 Mar 2012 07:42:02 -0000 Delivered-To: apmail-incubator-flex-dev-archive@incubator.apache.org Received: (qmail 11334 invoked by uid 500); 26 Mar 2012 07:41:57 -0000 Mailing-List: contact flex-dev-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: flex-dev@incubator.apache.org Delivered-To: mailing list flex-dev@incubator.apache.org Received: (qmail 11300 invoked by uid 99); 26 Mar 2012 07:41:56 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 26 Mar 2012 07:41:56 +0000 X-ASF-Spam-Status: No, hits=-0.7 required=5.0 tests=RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of cosmacol@gmail.com designates 209.85.215.47 as permitted sender) Received: from [209.85.215.47] (HELO mail-lpp01m010-f47.google.com) (209.85.215.47) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 26 Mar 2012 07:41:49 +0000 Received: by lagw12 with SMTP id w12so3612579lag.6 for ; Mon, 26 Mar 2012 00:41:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type:content-transfer-encoding; bh=4RGqJ6lh0rmBSzuyYxXCqhFxYEuJWUc2V6siLRTLH9k=; b=XomidkOq2TuCaLa6WkPkZKGWS5aEhkOjWhGk5DEIl3091+xCoa9nWuO8XYE8AG5oWC I3RQov5Qqri1Uy9X2O8jItToMN0RlfVlM+OzVklqEDWaa/vYwR6hezwx/n0ePwA+PLGz CGYzg7NziPhf6DSVrf980Akc855FtkCZIoeEW8dDW772b4jmUoweBaQsMAUW+7Tdie/F Jfy8aLINtoRYVCMHJRKA11oJrmzExB2VmRvfuzNjxPKhF0eI6R8S32TjFy7+teAf987X 3+ZhMcZkTcC2Y7TmkO+2QJkC0UHOTmaJJJr5ELbIwipBfmaD+ggt+JNhi+tdcmKM3JQK uJBQ== Received: by 10.112.10.41 with SMTP id f9mr2391019lbb.46.1332747688994; Mon, 26 Mar 2012 00:41:28 -0700 (PDT) MIME-Version: 1.0 Received: by 10.112.109.133 with HTTP; Mon, 26 Mar 2012 00:41:08 -0700 (PDT) In-Reply-To: <52B2F252-22C7-4375-BE97-50B8B75F0A3F@classsoftware.com> References: <4F6BB7E0.3030202@thedevprocess.com> <4F6E1578.8070606@thedevprocess.com> <52B2F252-22C7-4375-BE97-50B8B75F0A3F@classsoftware.com> From: Cosma Colanicchia Date: Mon, 26 Mar 2012 09:41:08 +0200 Message-ID: Subject: Re: Actionscript workers and async locking? To: flex-dev@incubator.apache.org Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable @LeftRight: about faults.. the first idea on my mind was simply translating fault events into standard Error throwing, so you can use normal try/catch logic to handle failed sequences instead of explicitly analyzing the result of each "synchronized" invocation. @Robert: exactly, I don't really care about improving response time, I'd just like to write this kind of logic in a linear method instead of having it scattered in multiple event listener methods.. it's about code readability and verbosity. Thanks very much for the links, I'm going to read it carefully. @Roland: as3commons-async looks nice, it looks that they are trying, with the Task class, to mitigate the same pain I was talking about. I think that, without any real "thread locking" API, it can't get much better than this. @Martin: that would be an improvement: using premises instead of creating a lot of ICountProvider and IConditionProvider to express control flows (probably, they could be built on top of these interfaces). I feel like a lot of people tried and are trying to address the disadvantages of coding async control flows. So I ask myself again: with worker threads, wouldn't it be simpler to just ask to synchronize the thread on the async token, i.e. locking it until result/fault? Cosma 2012/3/26 Justin Mclean : > Hi, > >> It sounds like you really can't do much about the timing of your bootstr= ap if one call is dependent upon the result of your prior call. Even if you= had threads available, you'd be waiting the same amount of time. > > Event maps in the Mate framework I find quite useful for this sort of iss= ue (http://mate.asfusion.com/). > > Here's a code snippet (from an old Flex3 project I had lying about so mig= ht be a little out of date) that give you a feel for event maps in Mate: > > =C2=A0 =C2=A0 =C2=A0 =C2=A0 > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 > =C2=A0 =C2=A0 =C2=A0 =C2=A0 > > =C2=A0 =C2=A0 =C2=A0 =C2=A0 > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 > =C2=A0 =C2=A0 =C2=A0 =C2=A0 > > Thanks, > Justin