Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:108292 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 4478 invoked from network); 28 Jan 2020 17:49:21 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 28 Jan 2020 17:49:21 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 3ADF6180531 for ; Tue, 28 Jan 2020 07:59:47 -0800 (PST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on php-smtp4.php.net X-Spam-Level: X-Spam-Status: No, score=-0.2 required=5.0 tests=BAYES_20,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,HTML_MESSAGE, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.2 X-Spam-ASN: AS15169 209.85.128.0/17 X-Spam-Virus: No X-Envelope-From: Received: from mail-oi1-f178.google.com (mail-oi1-f178.google.com [209.85.167.178]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Tue, 28 Jan 2020 07:59:46 -0800 (PST) Received: by mail-oi1-f178.google.com with SMTP id l9so10766500oii.5 for ; Tue, 28 Jan 2020 07:59:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to; bh=IeloTQV4y37zBxwW97Yhsp9ip8fXW7bykdEiPSAWkKc=; b=X3xh+R84wsZMXVSB+jzs9WKG8QCJ85vdx1tOG3Kb0LA77CVUKUGCZcRO5Iv9m/J0Df 02Yul6gvhvuPgsNarbJTs9di3SZLno5d86+h0miggQuJKmjMBp3fbP+A3XzHbFyl/G++ YVr3+mRvZMMRr8RDl7KAJZu+pWCgIxGgqP1uMp/NSApxChC6aZsZ000eyhQyD384rsMO miw00Hro4KVJBPD5ifhg6OA303LkUoDq/wID++xK/cRDU3dtwUhSCMSk08H7zjo4nhz8 2zs6YC7tXEEYu43rzizUleBcWlgtWlIc3hmQifs6vPIm0klRH3XDcNxuYKUHFUFzSjAt 5RMg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to; bh=IeloTQV4y37zBxwW97Yhsp9ip8fXW7bykdEiPSAWkKc=; b=MG6lu5SgWXJkb9y8E9Y4HxJLYZpNLB4tktkayX4tomdGfVUZDdcf42AgJE3hH10AWc GRSiP9ZF3qEK67BaHN50gwS0YMW+cfip4Sc9nFKRe5zsSgu2kgMCBRc6q42jPeKdzSCU TW4uERzbjnwElp4BJNw0nY74bJGw4lEOpsotm3RgmmHrHmf+O/mGzsLCv64xlzt8z9ZG j26ZExBiB2+y1gCjgGa5vhV+1i/1QIXgQ61DZoVbSEYNR1A7ah4cXWEi5GEUBshV+n8h JEK4DdFovxZe4r2xedz6PRX3q1hRD6vgYb8F310j96yjNutwGt8ZLPgQFDXvIAOLqgdY oB0w== X-Gm-Message-State: APjAAAVhiRhDah3jDPEawW3/W/9C2fCQbFQGo6W3ZnZuZVkb9zOPodfO FG/cTk30Ce7vNbliqlzUnAvw1+82 X-Google-Smtp-Source: APXvYqzE83eH+xPrhno0r8IWeqh2S+X2gVMO4JxNQjnplZVSnzjptK6wRCr2jrPDTZkKmDwehjQ5lQ== X-Received: by 2002:aca:3a05:: with SMTP id h5mr3386106oia.3.1580227185621; Tue, 28 Jan 2020 07:59:45 -0800 (PST) Received: from mail-oi1-f178.google.com (mail-oi1-f178.google.com. [209.85.167.178]) by smtp.gmail.com with ESMTPSA id j20sm6897276otp.24.2020.01.28.07.59.44 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 28 Jan 2020 07:59:44 -0800 (PST) Received: by mail-oi1-f178.google.com with SMTP id a142so9184081oii.7 for ; Tue, 28 Jan 2020 07:59:44 -0800 (PST) X-Received: by 2002:aca:ed81:: with SMTP id l123mr3326572oih.129.1580227184529; Tue, 28 Jan 2020 07:59:44 -0800 (PST) MIME-Version: 1.0 References: <3ca6d665-1a4f-8f7a-c82a-2e899f2e8df1@gmail.com> <44ba543d-b6eb-888b-9ed5-0f1e9d3b53b9@gmail.com> <8E382251-AE41-4BD9-A5F8-135D11B9E10D@newclarity.net> In-Reply-To: Date: Tue, 28 Jan 2020 15:59:08 +0000 X-Gmail-Original-Message-ID: Message-ID: To: PHP internals Content-Type: multipart/alternative; boundary="000000000000ffa807059d354f53" Subject: Re: [PHP-DEV] Add viable long running execution model to php 8 From: phpmailinglists@gmail.com (Peter Bowyer) --000000000000ffa807059d354f53 Content-Type: text/plain; charset="UTF-8" On Tue, 28 Jan 2020 at 14:26, Thomas Hruska 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 --000000000000ffa807059d354f53--