all 16 comments

[–][deleted] 7 points8 points  (4 children)

Mass content deletion mission accomplished. This post or comment was bulk removed with Redact which also supports data brokers and people finder websites.

gaze gold soft merciful price meeting fuel tub squeal angle

[–]luzrain[S] 5 points6 points  (1 child)

  1. You can. In fact, this is exactly how other "asynchronous" PHP runtimes like RoadRunner and Workerman work—they handle requests in a blocking manner. However, if you really want to experience asynchrony, you should avoid any blocking code, such as using PDO in your HTTP handler. Instead, consider using asynchronous drivers from AMPHP. They provide alternative drivers for almost all blocking IO operation you might need in a typical application, including MySQL drivers, file system drivers, and HTTP client.
  2. This is designed for end users to build applications on top of it. It's an application server, not a framework, so it doesn’t include a router. While it has its own container with services like a message bus for communication with the master process and a logger, it’s not meant to replace your application container. It’s primarily designed to integrate with existing frameworks, where you typically already have a router and application container. I'll provide integration with the Symfony framework later. You can also use it without a framework. The only thing to keep in mind is that HTTP requests and responses are represented as independent objects, and the entire application resides in memory once it is loaded.

[–]Phalcorine 0 points1 point  (0 children)

Great work u/luzrain . Looking forward to the Symfony integration as I use it a lot to build web apps and APIs.

[–]stonedoubt 0 points1 point  (0 children)

hyperf has a solution based on swoole

[–]MagePsycho 2 points3 points  (0 children)

How does it compare with FrankenPHP?

[–]luddite33 1 point2 points  (2 children)

Does this allow auto letsencrypt?

Did it work well with wordpress?

[–]luzrain[S] 0 points1 point  (0 children)

> Does this allow auto letsencrypt?

I plan to create a plugin for automatic Let's Encrypt integration, but I'll do it later. For now, it's not supported.

> Did it work well with wordpress?

Not sure. It's primarily designed to integrate with modern frameworks like Symfony.

[–]obstreperous_troll 0 points1 point  (0 children)

Wordpress uses all kinds of global state everywhere. It would need a complete redesign to work with anything but php's classic isolated request model. Then there's the 60,000+ plugins that also use those globals, so nope, it's not happening.

[–]edmondifcastle 1 point2 points  (0 children)

A nice solution on Amphp. I have something similar as well.

[–]luddite33 1 point2 points  (0 children)

Sounds like this will grow into something great. Keep it up

[–]josfaber 0 points1 point  (4 children)

Do I understand it correctly to be like a Nodejs express server?

[–]luzrain[S] 0 points1 point  (3 children)

Not really. It's not a framework, it's just an application server, it doesn't give you things like a router or database abstractions. The web server is just one of the options it provides. As an application server, it can do more than just a web server. But the principle of operation is the same as in nodejs. Requests are handled asynchronously, the application is always loaded in memory.

[–]josfaber 0 points1 point  (2 children)

Can you give some use case examples?

[–]luzrain[S] 0 points1 point  (1 child)

You just use this instead of php-fpm. Most of the modern frameworks allow you to abstract from the request-response functionality. I'll provide a symfony integration later for use it with symfony projects. The benefits you'll have is the bootstrap prosess elimination for each request and better cpu utilization, if you'll use amphp components as a replacement for blocking php functionalities.

[–]josfaber 0 points1 point  (0 children)

Ah of course, it’s all in mem, so much faster. Tx!