Skip to content

Commit b41a805

Browse files
chore: add deprecation notices for some methods
Those methods are now replaced by more generic methods at the server level, and will be removed in the next major release. Regarding the allRooms() method, we may also remove it, as transferring all rooms (including private ones) across the cluster is not really efficient, and users could use `serverSideEmit()` instead to implement their own logic.
1 parent 672dc0c commit b41a805

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

lib/index.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -652,6 +652,8 @@ export class RedisAdapter extends Adapter {
652652
}
653653

654654
/**
655+
* @deprecated Please use `namespace.fetchSockets()` instead.
656+
*
655657
* Gets a list of sockets by sid.
656658
*
657659
* @param {Set<Room>} rooms the explicit set of rooms to check.
@@ -741,6 +743,8 @@ export class RedisAdapter extends Adapter {
741743
}
742744

743745
/**
746+
* @deprecated Please use `namespace.socketsJoin()` instead.
747+
*
744748
* Makes the socket with the given id join the room
745749
*
746750
* @param {String} id - socket id
@@ -785,6 +789,8 @@ export class RedisAdapter extends Adapter {
785789
}
786790

787791
/**
792+
* @deprecated Please use `namespace.socketsLeave()` instead.
793+
*
788794
* Makes the socket with the given id leave the room
789795
*
790796
* @param {String} id - socket id
@@ -829,7 +835,10 @@ export class RedisAdapter extends Adapter {
829835
}
830836

831837
/**
838+
* @deprecated Please use `namespace.disconnectSockets()` instead.
839+
*
832840
* Makes the socket with the given id to be forcefully disconnected
841+
*
833842
* @param {String} id - socket id
834843
* @param {Boolean} close - if `true`, closes the underlying connection
835844
*

0 commit comments

Comments
 (0)