-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
We had to make a few changes to the redis module (in the vendor/ directory), in order to implement the feature. We will remove it once the changes are merged upstream. See also: denodrivers/redis#335 This implementation is compatible with the Node.js one (same format for the Redis channels and the packets). See also: https://github.com/socketio/socket.io-redis-adapter
- Loading branch information
1 parent
96a227b
commit 39eaa0e
Showing
27 changed files
with
2,995 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
version: "3.0" | ||
services: | ||
redis: | ||
image: redis:5 | ||
ports: | ||
- "6379:6379" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,47 @@ | ||
export { Server, type ServerOptions } from "./packages/socket.io/mod.ts"; | ||
export { | ||
Adapter, | ||
type BroadcastOptions, | ||
type Namespace, | ||
Server, | ||
type ServerOptions, | ||
type Socket, | ||
} from "./packages/socket.io/mod.ts"; | ||
|
||
/** | ||
* The Redis adapter, to broadcast packets between several Socket.IO servers | ||
* | ||
* Documentation: https://socket.io/docs/v4/redis-adapter/ | ||
* | ||
* Usage: | ||
* | ||
* ``` | ||
* import { serve } from "https://deno.land/std/http/server.ts"; | ||
* import { Server, createRedisAdapter, createRedisClient } from "https://deno.land/x/socket_io/mod.ts"; | ||
* | ||
* const [pubClient, subClient] = await Promise.all([ | ||
* createRedisClient({ | ||
* hostname: "localhost", | ||
* }), | ||
* createRedisClient({ | ||
* hostname: "localhost", | ||
* }) | ||
* ]); | ||
* | ||
* const io = new Server({ | ||
* adapter: createRedisAdapter(pubClient, subClient) | ||
* }); | ||
* | ||
* await serve(io.handler(), { | ||
* port: 3000 | ||
* }); | ||
* ``` | ||
*/ | ||
export { | ||
createAdapter as createRedisAdapter, | ||
type RedisAdapterOptions, | ||
} from "./packages/socket.io-redis-adapter/mod.ts"; | ||
|
||
/** | ||
* Temporary export to provide a workaround for https://github.com/denodrivers/redis/issues/335 | ||
*/ | ||
export { connect as createRedisClient } from "./vendor/deno.land/x/[email protected]/mod.ts"; |
Oops, something went wrong.