Re: Add viable long running execution model to php 8

From: Date: Tue, 28 Jan 2020 15:59:08 +0000
Subject: Re: Add viable long running execution model to php 8
References: 1 2 3 4 5 6 7  Groups: php.internals 
Request: Send a blank email to internals+get-108292@lists.php.net to get a copy of this message
On Tue, 28 Jan 2020 at 14:26, Thomas Hruska <thruska@cubiclesoft.com> wrote: > People tend to write WebSocket servers in NodeJS partly because they > don't realize that PHP can already do the same. Example: > > https://github.com/cubiclesoft/php-drc I didn't realize, so this is a great share. Thanks. > WebSocket generally introduces network and processing overhead - HTTP > headers and parsing for setup + framing protocol handling. In many > cases, a simpler "JSON blob per newline" approach works just as well (if > not better) and can afford better isolation and performance models (i.e. > not everything has to be WebSocket). There are plenty of flaws inherent > to the design of the WebSocket protocol itself (some are > security-oriented) and so anything built on it shares those flaws. > This critique of WebSockets sounds similar to that of https://mercure.rocks/, which uses HTTP/2 and Server-Sent Events instead of WebSockets. I'm interested in WebSockets because I've been following the development of Phoenix LiveView [1] for the last 13 months. Something similar in PHP would be awesome (though the statelessness of PHP will complicate matters), but when I looked at Swoole et al they wouldn't work with my existing framework-based code. An approach that avoids rewriting, like some form of built-in support in the language would be good for this alone. Peter 1. https://dockyard.com/blog/2018/12/12/phoenix-liveview-interactive-real-time-apps-no-need-to-write-javascript

« previous php.internals (#108292) next »