1
0
Fork 0
mirror of synced 2024-06-26 18:20:43 +12:00

Merge branch 'feat-265-realtime' of https://github.com/appwrite/appwrite into feat-265-realtime-console

This commit is contained in:
Torsten Dittmann 2021-08-19 11:41:31 +02:00
commit a18dfc9daf
3 changed files with 30 additions and 28 deletions

View file

@ -88,23 +88,23 @@ $server->onWorkerStart(function (int $workerId) use ($server, $register, $stats,
* Sending current connections to project channels on the console project every 5 seconds.
*/
if ($realtime->hasSubscriber('console', 'role:member', 'project')) {
$payload = [];
foreach ($stats as $projectId => $value) {
$payload[$projectId] = $value['connectionsTotal'];
$payload = [
'projectId' => $value['connectionsTotal']
];
$event = [
'project' => 'console',
'roles' => ['team:'.$projectId],
'data' => [
'event' => 'stats.connections',
'channels' => ['project'],
'timestamp' => time(),
'payload' => $payload
]
];
$server->send($realtime->getSubscribers($event), json_encode($event['data']));
}
$event = [
'project' => 'console',
'roles' => ['role:member'],
'data' => [
'event' => 'stats.connections',
'channels' => ['project'],
'timestamp' => time(),
'payload' => $payload
]
];
$server->send($realtime->getSubscribers($event), json_encode($event['data']));
}
/**
* Sending test message for SDK E2E tests every 5 seconds.

View file

@ -51,7 +51,7 @@
"utopia-php/domains": "1.1.*",
"utopia-php/swoole": "0.2.*",
"utopia-php/storage": "0.5.*",
"utopia-php/websocket": "dev-main",
"utopia-php/websocket": "0.0.*",
"utopia-php/image": "0.5.*",
"resque/php-resque": "1.3.6",
"matomo/device-detector": "4.2.3",
@ -69,12 +69,6 @@
"textalk/websocket": "1.5.2",
"vimeo/psalm": "4.7.2"
},
"repositories": [
{
"type": "git",
"url": "https://github.com/utopia-php/websocket.git"
}
],
"provide": {
"ext-phpiredis": "*"
},

20
composer.lock generated
View file

@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically"
],
"content-hash": "b5f4227860b0b7697a79405cc8bdfba9",
"content-hash": "d0304d97605ec2f0be74b0d87ad7597a",
"packages": [
{
"name": "adhocore/jwt",
@ -2177,12 +2177,18 @@
},
{
"name": "utopia-php/websocket",
"version": "dev-main",
"version": "0.0.1",
"source": {
"type": "git",
"url": "https://github.com/utopia-php/websocket.git",
"reference": "808317ef4ea0683c2c82dee5d543b1c8378e2e1b"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/utopia-php/websocket/zipball/808317ef4ea0683c2c82dee5d543b1c8378e2e1b",
"reference": "808317ef4ea0683c2c82dee5d543b1c8378e2e1b",
"shasum": ""
},
"require": {
"php": ">=8.0"
},
@ -2193,13 +2199,13 @@
"vimeo/psalm": "^4.8.1",
"workerman/workerman": "^4.0"
},
"default-branch": true,
"type": "library",
"autoload": {
"psr-4": {
"Utopia\\WebSocket\\": "src/WebSocket"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
@ -2221,6 +2227,10 @@
"utopia",
"websocket"
],
"support": {
"issues": "https://github.com/utopia-php/websocket/issues",
"source": "https://github.com/utopia-php/websocket/tree/0.0.1"
},
"time": "2021-07-11T13:09:44+00:00"
},
{
@ -6164,9 +6174,7 @@
],
"aliases": [],
"minimum-stability": "stable",
"stability-flags": {
"utopia-php/websocket": 20
},
"stability-flags": [],
"prefer-stable": false,
"prefer-lowest": false,
"platform": {