Re: [PDO] Asynchronous requests

[email protected] (Pierre Joye) Tue, 3 Nov 2009 14:47:16 +0100
Newsgroups php.pdo
Message-ID <[email protected]>
On Tue, Nov 3, 2009 at 2:37 PM, Lukas Kahwe Smith <[email protected]> wrote:
>
> On 03.11.2009, at 14:26, Pierre Joye wrote:
>
>> I would rather not implement them until we actually make the necessary
>> changes to support them in all drivers, as long as a backend supports
>> this given feature. We have to keep in mind that PDO does not aim to
>> be a new native layer but to provide a common API to access all
>> supported databases in portable way (from an API point of view, at
>> least).
>
>
> Well, but that means you cannot use PDO if you do want to use some of these
> features. This cannot be the long term vision. The long term vision imho
> must be to get rid of the old extensions (even if only in PHP7).

Agreed, that's not for the long term but for what we have now.

A new model would allow driver(s) specific features while using driver
specific properties. They should not be shown in the global PDO
namespace but inside each specific driver, both in the implementation
and in the code. The users can then choose wisely to use them or not
(being portable or not, using driver optimization or not). Such things
are not possible in the current implementation, by design and by
technical limitation.


> To me the question is just when a feature is ready to become part of the
> unified layer and how to deal with features we are not yet sure about.
>
> like with async .. lets say for now we are not yet sure enough about a
> unified API so we prefix:
> PDO_MySQL::mysqlAsyncQuery()
> PDO:PgSQL::pgsqlAsyncQuery()
>
> one day we become more comfortable and add it to PDO core throwing an
> error/exception if the feature is not available:
> PDO::asyncQuery()

I'm not sure yet how to deal with that. But new APIs should be
carefully designed and implemented, unlike some of them we have in
1.x.

All in all you raised a valid point here, add it to the brainstorm page? :)

Cheers,
-- 
Pierre

http://blog.thepimp.net | http://www.libgd.org