Socket.IO setInterval maximum call stack exceeded
up vote
-1
down vote
favorite
i'm currently building an web app where people coud create rooms and rent an other person, in this room there is a setInterval that will periodically emit the time left in that room (01:00:00... 00:59:59) something like that. The problem is now 2 people in that room both have a button that can quickly terminate the timer to cancel the room. How do I store the set interval id to a common variable to let the 2 sockets know? I have tried storing them in mongodb but it throw a recursive error, neither can I emit the set interval object back to the client because it will throw maxium callstack exceeded.
Thank you so much.
node.js mongodb socket.io
add a comment |
up vote
-1
down vote
favorite
i'm currently building an web app where people coud create rooms and rent an other person, in this room there is a setInterval that will periodically emit the time left in that room (01:00:00... 00:59:59) something like that. The problem is now 2 people in that room both have a button that can quickly terminate the timer to cancel the room. How do I store the set interval id to a common variable to let the 2 sockets know? I have tried storing them in mongodb but it throw a recursive error, neither can I emit the set interval object back to the client because it will throw maxium callstack exceeded.
Thank you so much.
node.js mongodb socket.io
You might find this thread useful: stackoverflow.com/questions/858619/…
– eicksl
Nov 11 at 5:21
1
It's unlikely anyone can help you without seeing the relevant code. You can't share at timerID to other processes.
– jfriend00
Nov 11 at 6:15
add a comment |
up vote
-1
down vote
favorite
up vote
-1
down vote
favorite
i'm currently building an web app where people coud create rooms and rent an other person, in this room there is a setInterval that will periodically emit the time left in that room (01:00:00... 00:59:59) something like that. The problem is now 2 people in that room both have a button that can quickly terminate the timer to cancel the room. How do I store the set interval id to a common variable to let the 2 sockets know? I have tried storing them in mongodb but it throw a recursive error, neither can I emit the set interval object back to the client because it will throw maxium callstack exceeded.
Thank you so much.
node.js mongodb socket.io
i'm currently building an web app where people coud create rooms and rent an other person, in this room there is a setInterval that will periodically emit the time left in that room (01:00:00... 00:59:59) something like that. The problem is now 2 people in that room both have a button that can quickly terminate the timer to cancel the room. How do I store the set interval id to a common variable to let the 2 sockets know? I have tried storing them in mongodb but it throw a recursive error, neither can I emit the set interval object back to the client because it will throw maxium callstack exceeded.
Thank you so much.
node.js mongodb socket.io
node.js mongodb socket.io
asked Nov 11 at 3:42
Henry
334
334
You might find this thread useful: stackoverflow.com/questions/858619/…
– eicksl
Nov 11 at 5:21
1
It's unlikely anyone can help you without seeing the relevant code. You can't share at timerID to other processes.
– jfriend00
Nov 11 at 6:15
add a comment |
You might find this thread useful: stackoverflow.com/questions/858619/…
– eicksl
Nov 11 at 5:21
1
It's unlikely anyone can help you without seeing the relevant code. You can't share at timerID to other processes.
– jfriend00
Nov 11 at 6:15
You might find this thread useful: stackoverflow.com/questions/858619/…
– eicksl
Nov 11 at 5:21
You might find this thread useful: stackoverflow.com/questions/858619/…
– eicksl
Nov 11 at 5:21
1
1
It's unlikely anyone can help you without seeing the relevant code. You can't share at timerID to other processes.
– jfriend00
Nov 11 at 6:15
It's unlikely anyone can help you without seeing the relevant code. You can't share at timerID to other processes.
– jfriend00
Nov 11 at 6:15
add a comment |
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53245645%2fsocket-io-setinterval-maximum-call-stack-exceeded%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
You might find this thread useful: stackoverflow.com/questions/858619/…
– eicksl
Nov 11 at 5:21
1
It's unlikely anyone can help you without seeing the relevant code. You can't share at timerID to other processes.
– jfriend00
Nov 11 at 6:15