Hi,

On Tue, Dec 18, 2012 at 6:03 AM, Stas Malyshev <smalys...@sugarcrm.com>wrote:

> Hi!
>
> > Basically the method allows you to do delegate error handling to the
> > coroutine, rather than doing it yourself (as you are not always able to
> do
> > it). It is particularly useful in more complicated settings, e.g. if you
> > are doing task scheduling through coroutines. For a small sample of how
>
> Could you expand on this point a bit more? It sounds like using
> exceptions for flow control, which is usually a very bad idea.
>

I've been hearing this argument from time to time and I don't understand
it; aren't exceptions created with the sole purpose of (error) flow control?

If so, then how can "exceptions for flow control" and "very bad idea" be
mentioned in the same sentence unless there are particular bad use cases
that are implicitly referred to when saying this?

If not, then perhaps my understanding of exceptions needs a spring cleaning
:)


>
> > this looks like see http://taskjs.org/. What the ->throw() method would
> do
> > in these examples is that it allows to check for errors by try/catching
> the
> > yield statement (rather than going for some odd solution with error
> > callbacks).
>
> Could you point to some specific example?
>
> --
> Stanislav Malyshev, Software Architect
> SugarCRM: http://www.sugarcrm.com/
> (408)454-6900 ext. 227
>
> --
> PHP Internals - PHP Runtime Development Mailing List
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>


-- 
--
Tjerk

Reply via email to