Giter VIP home page Giter VIP logo

Comments (8)

Salmondx avatar Salmondx commented on May 19, 2024 6

Sorry for "necroposting", but have you guys had time to think how to integrate these third party octane plugins?

Been playing with Workerman for a couple weeks and so far it have been great. Main selling point for it is that it's codebase is pretty "simple", its pure php (just a composer package based on pcntl and optional event extension) and it doesn't require installing any third party extensions that you have to trust (like swoole for example) or require any third party web servers like roadrunner. Another side bonus is that its easy to setup xdebug with it.

It is hard to say about its performance (don't have any production experience with workerman) but based on artificial benchmarks (including some tests with PDO and multiple queries) it performs pretty well: https://www.techempower.com/benchmarks/#section=data-r21&hw=ph&test=fortune
Code for such tests is simple (https://github.com/TechEmpower/FrameworkBenchmarks/blob/master/frameworks/PHP/workerman/app.php) and it's hard to predict how it will work on real life apps.

It doesn't provide any cool features like swoole's coroutines but looks like PHP is slowly heading towards native concurrency anyways (recent Fibers RFC as I understand is a foundation for stuff that they plan to do in future).

TLDR; nice option for octane to have, single composer dependency without the need of any external extensions or web servers.

@nunomaduro sorry for a ping but it is such a nice proposal from barryvdh that imho worth reevaluation 😄

from octane.

barryvdh avatar barryvdh commented on May 19, 2024 5

Maybe instead of trying to support them all, we could see if it's possible to add servers with a 3rd party package? I think the most part doesn't need to live in Octane directly, as long as you can add the server somewhere.

from octane.

taylorotwell avatar taylorotwell commented on May 19, 2024 2

I think @barryvdh's suggestion of allowing this to be extendable third-party is a good idea.

from octane.

barryvdh avatar barryvdh commented on May 19, 2024

What is the benefit over Workerman over RoadRunner and Swoole? No binary/extension required? It does support PSR-7 so probably wouldn't be too hard to create; walkor/workerman#51 (comment)
But there is also amphp, php-pm etc

from octane.

szepeviktor avatar szepeviktor commented on May 19, 2024

https://github.com/php-pm/php-pm is a very nice project.
Will Octane support it?

from octane.

barryvdh avatar barryvdh commented on May 19, 2024

For reference, I create initial Workerman support. As you can see, I didn't need to change any of the core functions so far, only the ServiceProvider to add bindings (but you can do that 3rd party). Furthermore to actually start it with the octane:start instead of octane:workerman command, we would need to add it as an available server somewhere.
https://github.com/laravel/octane/compare/master...barryvdh:workerman?expand=1

(Not this isn't really tested, but it starts Workerman with the octane:workerman --host=0.0.0.0 --port=1234 --workers=4 parameters correctly, it serves Laravel and it shuts down the server. I didn't really get it to hot reload yet though (although I think I'm sending the right command Edit: fixed). Bit hard to debug further though because I have never used Workerman.

I can PR this but I'll leave it to the Octane team to see what their intention is for other providers.

from octane.

barryvdh avatar barryvdh commented on May 19, 2024

If you abstract it a bit more, at first we could consider moving the start command to the ServerInspector class, just as stop/reload. The state-file is mostly the same for servers like Workerman/Roadrunner/php-pm that have a master process (I guess at least) so maybe there can be 1 common ServerStateFile instead of per driver.
If the ServerInspector handles the starting and also the output formatting, there could be a general octane:start-server --server=roadrunner which just uses the registered ServerInspectors to start.

But ofcourse this is just thinking out load. Not sure which drivers there could be more, besides php-pm and Workerman now.

from octane.

taylorotwell avatar taylorotwell commented on May 19, 2024

No plans right now. It would primarily depend on how much code it is to maintain and what advantages it would offer against existing drivers.

from octane.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.