The short answer from Damien — a core committer of Socket.io
The adapter is a component inside the Socket.IO server, while the emitter can be used in another process/service.
And there are two diagrams in the documentation explaining the duties of each package
The long answer
They are pretty similar with the following two differences:
@socket.io/redis-adapter
- Must be linked with a
socket.io
server, And you must provide it a publish and subscribe redis client. like the following:
io.adapter(createAdapter(pubClient, subClient))
- Responsible to send/receive
socket.io
commands to/from other servers.
@socket.io/redis-emitter
- Can't be linked with a
socket.io
server, And you must provide it a publish redis client. like the following:
const emitter = new Emitter(pubClient);
- Responsible only to send
socket.io
commands to the other servers (that has @socket.io/redis-adapter
adapter with the same redis database connection and channel key configuration)
Note: These differences applies to all socket.io adapters and emitters (e.g. @socket.io/mongo-adapter
and @socket.io/mongo-emitter
)