We had a quick chat off list and I believe Cees-Jan agrees with me that this is not really feasible as is.

Having promise responses without a promise spec is not doable, and having optional promise responses means the interface can not be relied upon at all in libraries as it may return values or may return promises depending on which PSR-16 implementation you'd use.

One can still use a promise-based cache library in their app of course, but they'd have to use a PSR-6 or PSR-16 one to pass into libraries that require a cache.

Cheers

On 16/11/2016 22:59, Cees-Jan Kiewiet wrote:
This PSR looks splendid, well done. There are how ever a few concerns
with regards to async PHP. I'm aware there isn't a Promise PSR yet but
is it acceptable within this spec to return a promise instead of the
actual value on a get? Or to resolve or reject a promise on set instead
of returning true/false directly.

On Wed, Nov 16, 2016 at 8:04 PM, Stefano Torresi <stef...@torresi.io
<mailto:stef...@torresi.io>> wrote:


    Il giorno mer 16 nov 2016 alle ore 17:19 Jordi Boggiano
    <j.boggi...@seld.be <mailto:j.boggi...@seld.be>> ha scritto:

        This was also carried over from PSR-6 where Pool::save() returns
        bool.

        I am not really sure what's best here, I expect most
        implementation will
        throw anyway if they can't connect to the cache, and in other
        instances
        there is no reason a write should fail AFAIK.

        Any other opinions on this?


    I don't see any compelling advantage in the boolean return value and
    I'd prefer leaving it out, but there were a few people who argued in
    favor of it during PSR-6 review.

    As a side note, out of the most downloaded non-PSR-6 libraries
    listed in the first pages of Packagist, Zend\Cache and
    Doctrine\Cache do follow this convention, while almost every other
    don't.

    --
    You received this message because you are subscribed to the Google
    Groups "PHP Framework Interoperability Group" group.
    To unsubscribe from this group and stop receiving emails from it,
    send an email to php-fig+unsubscr...@googlegroups.com
    <mailto:php-fig+unsubscr...@googlegroups.com>.
    To post to this group, send email to php-fig@googlegroups.com
    <mailto:php-fig@googlegroups.com>.
    To view this discussion on the web visit
    
https://groups.google.com/d/msgid/php-fig/CAFojS1sV1YTy5A-rjqq5syGPMbVAcBn1WA-D62BDsgV0yVp3wg%40mail.gmail.com
    
<https://groups.google.com/d/msgid/php-fig/CAFojS1sV1YTy5A-rjqq5syGPMbVAcBn1WA-D62BDsgV0yVp3wg%40mail.gmail.com?utm_medium=email&utm_source=footer>.

    For more options, visit https://groups.google.com/d/optout
    <https://groups.google.com/d/optout>.


--
You received this message because you are subscribed to the Google
Groups "PHP Framework Interoperability Group" group.
To unsubscribe from this group and stop receiving emails from it, send
an email to php-fig+unsubscr...@googlegroups.com
<mailto:php-fig+unsubscr...@googlegroups.com>.
To post to this group, send email to php-fig@googlegroups.com
<mailto:php-fig@googlegroups.com>.
To view this discussion on the web visit
https://groups.google.com/d/msgid/php-fig/CAPY1sU8tU7VrWvuSMjxMwd5qMvDfQbgmc0E_P2dowJMoHt%3D%2BDQ%40mail.gmail.com
<https://groups.google.com/d/msgid/php-fig/CAPY1sU8tU7VrWvuSMjxMwd5qMvDfQbgmc0E_P2dowJMoHt%3D%2BDQ%40mail.gmail.com?utm_medium=email&utm_source=footer>.
For more options, visit https://groups.google.com/d/optout.


--
Jordi Boggiano
@seldaek - http://seld.be

--
You received this message because you are subscribed to the Google Groups "PHP 
Framework Interoperability Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to php-fig+unsubscr...@googlegroups.com.
To post to this group, send email to php-fig@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/php-fig/34f70364-2cdd-2d78-3e2c-d0c488bf29af%40seld.be.
For more options, visit https://groups.google.com/d/optout.

Reply via email to