Open elpoleto opened 5 years ago
@elpoleto I've not needed to do this before and haven't read up on this feature, so I'm not 100% clear on why you would do this. Could you provide a solid use-case?
yes, sure, in my case i communicate with a iot device. for some actions i need the $loop->addTimer() to check a sort of timeouts but in my own class (in my case extends "RatchetWsServer") there is no access to the loop
For now i implemented my own command and exclude the package one by composer.json as: .... "autoload": { "files": [ "app/Library/helpers.php", "app/overrides/RatchetServerCommand.php" ], "classmap": [ "database/seeds", "database/factories" ], "psr-4": { "App\": "app/" }, "exclude-from-classmap": [ "vendor/askedio/laravel-ratchet/src/Console/Commands/RatchetServerCommand.php" ] }, .....
all this to rewrite this simple call in method "createServerInstance()", that is private, to pass the $loop to the class .... $this->serverInstance = $this->ratchetServer = new $class($this, $this->getEventLoop()) ....
Is this project still alive?
Hi
We are looking for more maintainers and am happy to merge PRs but there is not much active development on this project.
Is there no way to access the main loop throught the application class? It would be useful to add timer etc
In ratchet is possible as (for example WebSocket Server): $server = new IoServer(new HttpServer(new WsServer(new Chat($loop))), $socket, $loop);