socket.io-adapter

The Socket.IO in-memory adapter

MIT License

Downloads
23.6M
Stars
195
Committers
26

Bot releases are hidden (Show)

socket.io-adapter - 2.5.4 Latest Release

Published by darrachequesne 8 months ago

Bug Fixes

  • ensure the order of the commands (a13f35f)
  • types: ensure compatibility with TypeScript < 4.5 (ca397f3)

Links

socket.io-adapter - 2.5.3

Published by darrachequesne 8 months ago

Two abstract classes were imported from the Redis adapter repository:

  • the ClusterAdapter class, which manages the messages sent between the server instances of the cluster
  • the ClusterAdapterWithHeartbeat class, which extends the ClusterAdapter and adds a heartbeat mechanism in order to check the healthiness of the other instances

Other adapters can then just extend those classes and only have to implement the pub/sub mechanism (and not the internal chit-chat protocol):

class MyAdapter extends ClusterAdapterWithHeartbeat {
  constructor(nsp, pubSub, opts) {
    super(nsp, opts);
    this.pubSub = pubSub;
    pubSub.subscribe("main-channel", (message) => this.onMessage(message));
    pubSub.subscribe("specific-channel#" + this.uid, (response) => this.onResponse(response));
  }

  doPublish(message) {
    return this.pubSub.publish("main-channel", message);
  }

  doPublishResponse(requesterUid, response) {
    return this.pubSub.publish("specific-channel#" + requesterUid, response);
  }
}

Besides, the number of "timeout reached: only x responses received out of y" errors (which can happen when a server instance leaves the cluster) should be greatly reduced by this commit.

Bug Fixes

  • cluster: fix count in fetchSockets() method (80af4e9)
  • cluster: notify the other nodes when closing (0e23ff0)

Performance Improvements

  • cluster: use timer.refresh() (d99a71b)

Links

socket.io-adapter - 2.5.2

Published by darrachequesne almost 2 years ago

The ws dependency was moved from peerDependencies to dependencies, in order to prevent issues like this.

Links

socket.io-adapter - 2.5.1

Published by darrachequesne almost 2 years ago

Bug Fixes

  • properly precompute the WebSocket frames (99b0f18)

Links

socket.io-adapter - 2.5.0

Published by darrachequesne almost 2 years ago

Features

  • implement connection state recovery (f529412)

Performance Improvements

  • precompute the WebSocket frames when broadcasting (5f7b47d)

Links

socket.io-adapter - 2.4.0

Published by darrachequesne over 2 years ago

Features

  • broadcast and expect multiple acks (a7f1c90)
  • notify listeners for each outgoing packet (38ee887)

Links

socket.io-adapter - 2.3.3

Published by darrachequesne almost 3 years ago

Bug Fixes

  • fix broadcasting volatile packets with binary attachments (88eee59)

Links

socket.io-adapter - 2.3.2

Published by darrachequesne about 3 years ago

Bug Fixes

  • fix race condition when leaving rooms (#74) (912e13a)

Links

socket.io-adapter - 2.3.1

Published by darrachequesne over 3 years ago

Bug Fixes

  • restore compatibility with binary parsers (a33e42b)

Links

socket.io-adapter - 2.3.0

Published by darrachequesne over 3 years ago

Features

  • add a serverSideEmit empty function (c4cbd4b)
  • add support for the "wsPreEncoded" writing option (5579d40)

Links

socket.io-adapter - 2.2.0

Published by darrachequesne over 3 years ago

Features

  • add some utility methods (1c9827e)
  • allow excluding all sockets in a room (#66) (985bb41)

Links

socket.io-adapter - 2.1.0

Published by darrachequesne almost 4 years ago

Features

Links

socket.io-adapter - 2.0.3

Published by darrachequesne almost 4 years ago

socket.io-adapter - 2.0.3-rc2

Published by darrachequesne almost 4 years ago

Features

  • add init() and close() methods (2e023bf)

Links

socket.io-adapter - 2.0.3-rc1

Published by darrachequesne about 4 years ago

socket.io-adapter - 2.0.2

Published by darrachequesne about 4 years ago

The dist/ directory was not up-to-date when publishing the previous version...

Links

socket.io-adapter - 2.0.1

Published by darrachequesne about 4 years ago

Bug Fixes

  • Adapter#encode() is now synchronous (c043650)

Links

socket.io-adapter - 2.0.0

Published by darrachequesne about 4 years ago

This release will be included in Socket.IO v3. It is not compatible with previous versions.

Features

Links

socket.io-adapter -

Published by darrachequesne almost 5 years ago

Bug fixes

  • fix memory leak when leave a room after socket close (#58)

Links

socket.io-adapter -

Published by darrachequesne about 7 years ago

Links