Commit graph

12 commits

Author SHA1 Message Date
Yohan Boniface
476c160fd5 wip(sync): clean stale username from redis
We wanted to use the HEXPIRE command, but discovered that this command
is only available since the Redis 7.4 version (the latest), and this version
does not have an OSI compliant licence, so it is generally not installable
through common packages managers. The OSS fork is Valkey, but it still does
not have the HEXPIRE command.

So we decide to clean those keys manually, and in order no do this clean
task at each websocket connection, we only do it when we are the first user
to connect to a given map.

Co-authored-by: David Larlet <david@larlet.fr>
2025-01-23 17:20:21 +01:00
Yohan Boniface
0d5e3047f4 wip(sync): only return peers with an active connection 2025-01-23 17:20:21 +01:00
Yohan Boniface
11fb29c456 wip(sync): log but do not crash when sending fail
This should be a race condition when sending to a closed websocket. Let's
log to track them.
2025-01-23 17:20:21 +01:00
Yohan Boniface
ef7c769abe wip(sync): remove a bit of server prints 2025-01-23 17:20:21 +01:00
Yohan Boniface
82342ea00f wip(sync): try a better pattern to unsubscribe to pubsub channels
When publishing a "STOP", this would unsubscribe every listener of the
channel.
2025-01-23 17:20:21 +01:00
Yohan Boniface
1bf100d7a8 wip(sync): make the client set its peer id 2025-01-23 17:17:16 +01:00
Yohan Boniface
36d9e9bf06 wip(sync): use the correct URL for websocket
Co-authored-by: David Larlet <david@larlet.fr>
2025-01-23 17:17:16 +01:00
Yohan Boniface
acb2e967b8 wip(sync): POC of using Redis for pubsub
Co-authored-by: David Larlet <david@larlet.fr>
2025-01-23 17:17:16 +01:00
Yohan Boniface
460a0c9997 wip(sync): only open listen connections after authentication 2025-01-23 17:16:44 +01:00
Yohan Boniface
698c74b427 wip(sync): only save Peer after authentication 2025-01-23 17:16:44 +01:00
Yohan Boniface
a29eae138e wip(sync): websocket server with ASGI and PostgreSQL LISTEN/NOTIFY 2025-01-23 17:16:44 +01:00
Yohan Boniface
31546d6ff4 wip(sync): use django-channels to serve websockets
Co-authored-by: David Larlet <david@larlet.fr>
2025-01-23 17:16:44 +01:00