-
Notifications
You must be signed in to change notification settings - Fork 638
[2.x] Major refactoring #447
Conversation
So So happy to see these things finally progressing. Will try and update this during the week and will test it out on staging. |
@lionslair Lovely!!! Hit the issues board for suggestions/issues. |
I will have not had a chance to enable yet. 2 / 12hr days. will do my best to get it turned on tomorrow. Thanks for putting the work in on these topics |
Codecov Report
@@ Coverage Diff @@
## master #447 +/- ##
=============================================
+ Coverage 48.57% 89.96% +41.38%
=============================================
Files 50 60 +10
Lines 1126 1545 +419
=============================================
+ Hits 547 1390 +843
+ Misses 579 155 -424
Continue to review full report at Codecov.
|
…ets into code-coverage
[2.x] Code coverage fixes
This comment has been minimized.
This comment has been minimized.
@lionslair It seems like the |
Solved. I edited the secret somehow this afternoon. I have spent all day trying to get this running on staging. I don't think the broadcaster websockets is working when using pubsub setup. I can see no messages in the dashboard being sent by laravel |
@lionslair The messages are being sent by the laravel's event classes or by using the dashboard form? |
|
I get that message from friday still. message: Argument 3 passed to BeyondCode\LaravelWebSockets\PubSub\Broadcasters\RedisPusherBroadcaster::broadcast() must be of the type array, null given, called in /home/PATH/vendor/beyondcode/laravel-websockets/src/Dashboard/Http/Controllers/SendMessage.php on line 41 |
@lionslair Try updating to latest |
Been sticking to |
Seems to post from the dashboard ok now but no events appear to be getting received from laravel that are being broadcast |
@rennokki does it make any sense why or how $connection can be empty? |
This feature is the pong tracker that was implemented just like Pusher docs explains it (120s time to ping the connection): 55f1332 The problem inflicted here is "what happens if the local connection suddenly drops"? If some VPS provider employee trips over a cable and the whole instance goes down without being able to SIGTERM/SIGINT the websockets process? The connections cannot be serialized to be safely stored, so-to-speak to have a stateful way of doing things. Once the connection falls down, it cannot be retrieved. However, we do keep presence channels' users and we can know when the user last connected, but that requires more logic to cleanup any socket ids stored and their members data for sockets that are not found on any server. |
…ts-disable [fix] Prevent collecting stats if disabled
That code is for handling dead websocket client connections. My suggestion was about dead websocket servers. All servers should keep an eye on whether each server has checked in with redis within a certain time period. If not, they should clear out any data that server was managing. |
@rennokki Am I missing something? |
The artisan command |
Any more testing needed to release the kraken? |
Guess we're good to go. 👀 |
[2.x] Customize dashboard domain and path using env vars
@morloderex This PR has become too large to handle at this point, so maybe it's a good idea to schedule it for a possible 3.x, since 2.x brings great improvements that might be worth pushing. |
I have talked with @mpociot and decided to take Laravel's way of doing things:
|
@rennokki i see you merged all tfrom 2.x branch into master branch nad delted 2.x branch. So how i install laravel-websockets 2 then ? :) |
@radudiaconu0 2.x is still under dev but i merged it into master to be able to handle the future prs better. This PR became too large to handle even for github (that threw unicorns when i tried to make a 2.x pr) 2.x is still available under latest beta. |
@rennokki so when i run composer require beyondcode/laravel-websockets this should install 1.x branch or master? :)) ( i guess 1.x) |
It will install latest 1.x release. The 1.x release is still on the 1.x branch |
Rewritten from scratch
The project got re-written from scratch as stated the reasons in #519
The contributors are going to remain the same, including @francislavoie with the awesome starting point to horizontally-scale the running servers.
Rewrite changelog
vendor:publish
to get the second migration file that changes the fields to plural.Beyondcode\LaravelWebSockets\Contracts\*
. If you extend certain functionalities, makes sure to use the right namespaced interfaces.WEBSOCKETS_REPLICATION_MODE
variable now can be set tolocal
orredis
.BeyondCode\LaravelWebSockets\Contracts\ChannelManager
interface.Statistics Collectors
. Their job is to temporarily store the data between dumps into the database (by default).PromiseInterfaces
for consistencies. This means that instead of returningint
or strings, you may now return aFulfilledPromise($value)
to easily get resolved. If you don't implement your own channel manager (or now defunct, replicator), it's totally fine..here()
methods.Pre-Rewrite changelog
Redis PubSub driver support for Horizontally-scaled WebSocket servers (Redis as a replication backend for scalability #140, Apply fixes from StyleCI #448, Add some extra ENV variables for the config file #477, 5b6bdf4)Rewritten, Channel Managers now do all the jobs on tracking the channels and connectionsAppProvider
toAppManager
to avoid conflicts with Larave's App Providers ([2.x] Refactor App Providers #451)Extendable hooks as in Exist a way to implement webhooks? #80 ([2.x] Extendable hook #465, 3e239a0)The extendable hooks' place in config file got changed. Get a new copy of the config file.Docblocks ([2.x] Docblocks #471)Rewritten from scratch.Custom statistics loggers (including the already-provided Database using ORM) ([2.x] Custom statistics drivers #473, 714cc5b, 108a717)Statistics Loggers now are called Statistics Collectors and their job is to store the data temporarily between dumps. When the amount of time in seconds pass, they are dumped into a Statistics Store. Defaults to Database.More use cases tests ([2.x] Test Refactoring #450, [refactor/tests] Added tests for Redis PubSub replication #453, [2.x] Redis connector tests #464, [2.x] Code coverage fixes #482)TDD-ed the entire project while keeping in mind the functionality tests.websockets
broadcaster for the horizontal scaling functionwebsockets:restart