Re: [VOTE] Fibers

From: Date: Mon, 08 Mar 2021 22:56:50 +0000
Subject: Re: [VOTE] Fibers
References: 1  Groups: php.internals 
Request: Send a blank email to internals+get-113420@lists.php.net to get a copy of this message
On Mon, Mar 8, 2021, at 1:40 PM, Aaron Piotrowski wrote:
> Greetings everyone!
> 
> The vote has started on the fiber RFC: https://wiki.php.net/rfc/fibers 
> <https://wiki.php.net/rfc/fibers>
> 
> Voting will run through March 22nd.
> 
> Cheers,
> Aaron Piotrowski

This is vastly improved from the earlier drafts I saw.  Well done, Aaron!

There is one issue that still stands out like a sore thumb to me, which I really should have
reviewed and caught earlier.  (Entirely my fault.)  Fiber::this() seems like a very poorly chosen
name for that method.  "this" in PHP implies "the object I am currently in." 
Even if there's no $ on a method, that's still the mental association that word has in
PHP.  But in this case, Fiber::this() does not mean "the object I'm currently in,"
but "the Fiber object that wraps the callable I'm currently in, which is itself an object
but not the object I mean, but there may be an arbitrary number of call stack levels between me and
that Fiber object."  That's... very confusing for a human, even if syntactically
unambiguous.

I am still voting Yes on the RFC, but I would urge you to follow-up (with another RFC, or a
consensus agreement, no one telling you not to, or whatever the process is, I'm easy) with
renaming that method to something less confusing.  Fiber::active() seems like the best name to me
(after some discussion with Aaron off-list), as it refers the fiber that is currently
"actively" executing opcodes.

Otherwise, well done and I look forward to when we can build a standardized user-facing API on top
of it. :-)

--Larry Garfield


Thread (71 messages)

« previous php.internals (#113420) next »