Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support volatile messages #821

Closed
wants to merge 3 commits into from
Closed

Support volatile messages #821

wants to merge 3 commits into from

Conversation

nkzawa
Copy link
Contributor

@nkzawa nkzawa commented Feb 19, 2015

This PR adds socket#volatile().

We have to merge socketio/engine.io-client#375 to pass all tests.

Related: #283, #710, socketio/socket.io#2003

@nkzawa nkzawa force-pushed the volatile branch 3 times, most recently from 009aec5 to 4b0db1d Compare February 23, 2015 16:25
@rauchg
Copy link
Contributor

rauchg commented Apr 6, 2015

We can do this without a function? If we make volatile an object that inherits from the parent.

@nkzawa
Copy link
Contributor Author

nkzawa commented Apr 6, 2015

Like expect.js does? I will work on it.

@rauchg
Copy link
Contributor

rauchg commented Apr 6, 2015

👍

@nkzawa
Copy link
Contributor Author

nkzawa commented Apr 12, 2015

Done. I used Object.create to create an inherited object, but I'm not so confident about this.
I think this approach has a risk to change states of wrong objects.

@nkzawa
Copy link
Contributor Author

nkzawa commented Apr 12, 2015

Another way is to create a class only for flags which has minimum sets of methods and properties instead like:

function Flag(socket, flag) {
  this.flags = {};
  this.flags[flag] = true;
  this.socket = socket;
  // TODO: creates flag properties.
}

Flag.prototype.emit = function() {
  this.socket.flags = this.flags;
  this.socket.emit.apply(this.socket, arguments);
  return this.socket;
};

Flag.prototype.compress = function() {...}

// socket.js
function Socket() {
  ...
  this.volatile = new Flag(this, 'volatile');
}

@IsaiahJTurner
Copy link

any plan to finish this feature?

@tracycollins
Copy link

Any plans for this? It would be much appreciated. Thanks!

@cinderblock
Copy link

cinderblock commented Jun 29, 2018

What is the state of this? I'd love to have this feature. As it stands, when my clients reconnect to the server, all of their pending requests come in at once and this causes some problems.

@H-s-O
Copy link

H-s-O commented Oct 8, 2019

Bumping for updates on this feature.

@kroko
Copy link

kroko commented Jan 26, 2020

Yet another bump. :)

@MadlyFX
Copy link

MadlyFX commented Jul 8, 2020

Another request for client>server volatile messaging

@darrachequesne
Copy link
Member

Merged into 7ddad2c and included in v3.

@darrachequesne darrachequesne added the enhancement New feature or request label Dec 11, 2020
@darrachequesne darrachequesne added this to the 3.0.0 milestone Dec 11, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants