Comments (8)
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.
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.
I think @barryvdh's suggestion of allowing this to be extendable third-party is a good idea.
from octane.
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.
https://github.com/php-pm/php-pm is a very nice project.
Will Octane support it?
from octane.
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.
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.
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)
- dump() only works in cli HOT 3
- Misleading error if port is already in use HOT 1
- vulnerability question, log handler problem, database connection exception HOT 6
- Error starting octane server swoole HOT 1
- Error PHP 8.3.3 10.46.0 Undefined constant "FTP_BINARY" HOT 2
- gmp and imagick and other extensions not loaded HOT 1
- Using Octane cause an issue with repeater fields from Laravel Nova HOT 1
- Error Too few arguments to function Illuminate\Cache\CacheManager::repository() HOT 2
- Octane does not call close() on Monolog Handler HOT 2
- Octane doesn't drop connections after docker container stopped HOT 4
- Bug: Target [Illuminate\Contracts\Routing\ResponseFactory] is not instantiable while building [Illuminate\Routing\ViewController]. with Breeze / Livewire HOT 16
- Fatal error with Swoole on a PUT request with application/x-www-form-urlencoded content type HOT 1
- Undefined array key "assets" HOT 4
- Invalid signature error with temporary signed routes HOT 1
- Loses communication with worker when using `dump()` HOT 4
- Swoole in HTTP/2 mode is incompatible with chunking large responses in `SwooleClient` HOT 1
- RoadRunner can't communicate with the worker HOT 20
- Octane fwrite no space on disk disable logging HOT 2
- SwooleHttpTaskDispatcher and Http::preventStrayRequests() HOT 3
- No documentation for custom HTTP headers? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from octane.