It may just be me, but what does that proposal add that isn’t currently 
accessible to us in the existing PSRs?

withFilename, withTmpFile, and withResource all returning a new Stream 
instance feels like they match pretty closely with PSR-17’s 
createStreamFromFile, createStream, and createStreamFromResource, 
respectively. Then the “late stream” part feels like an implementation 
detail of Stream, where a resource is only opened when the user acts on it.

Even if it is important enough to be able to separate normal (whatever that 
means) Stream from LateStream instances, would it not make more sense to 
put these with* methods in a factory?

What use do you envision the open method to have? Clearly we wouldn’t want 
users to have to call it before calling any other methods. And if the other 
methods must include this functionality anyway, why make it callable by the 
user at all?

I really do like the idea of using a Stream implementation that postpones 
file io as long as possible. I am mostly just baffled about the need for 
this new interface, so hopefully you can put forth some of the reasons why 
this can’t be done with the current PSRs :)



On Wednesday, 31 October 2018 11:01:25 UTC+1, Lcfvs wrote:

> Hi all,
>
> I just sent a proposal to add an interface to describe a late stream, 
> which doesn't requires an already opened resource.
>
> For the proposal, see https://github.com/php-fig/http-message/pull/82
>
> As said by Jean85:
>
> This is a completely non-trivial change to the spec, and also not an 
>> errata. I would say that you should push for this change opening a 
>> discussion on the PHP-FIG mailing list...
>>
>
> ... then I'm here. :D 
>
> My motivation is about the 
>
>    - server limitations (max opened files)
>    - performances in case of unused streams
>    - the ability to get a stream of broken uploaded file
>    - ...
>
> Indeed, it isn't an errata, I made it to avoid any breaking changes, it's 
> why a new interface.
>
> What do you think about it?
>

-- 
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/14cf3b16-ca12-4107-aa91-5429cfe20664%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to