-
Notifications
You must be signed in to change notification settings - Fork 591
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
Abort outstanding HTTP requests when subscription is closed #1104
Labels
api: pubsub
Issues related to the Pub/Sub API.
type: bug
Error or flaw in code with unintended results or allowing sub-optimal usage patterns.
Comments
It is probably a subscription object that is still pulling for new messages. You can quickly stop that process by calling subscription.removeAllListeners() |
Hey @stephenplusplus, thanks for your answer. let pubsub = gcloud.pubsub({
projectId: projectId,
keyFilename: keyPath
});
let topic = pubsub.topic('someTopic');
topic.subscribe('update', function (error, sub) {
if (error) {
return console.log(error);
}
sub.on('error', function (error) {
console.log(error);
});
sub.on('message', function (message) {
console.log(message);
});
setTimeout(function () {
sub.removeAllListeners();
}, 500);
}); |
Got to the bottom of this! Unfortunately, there are a few pieces involved...
|
stephenplusplus
added
type: bug
Error or flaw in code with unintended results or allowing sub-optimal usage patterns.
api: pubsub
Issues related to the Pub/Sub API.
labels
Feb 3, 2016
stephenplusplus
changed the title
How do I stop PubSub?
Abort outstanding HTTP requests when subscription is closed
Feb 5, 2016
sofisl
pushed a commit
that referenced
this issue
Nov 11, 2022
* fix: make `generate_index_ts()` deterministic (#1104) Fixes googleapis/synthtool#1103 Source-Link: googleapis/synthtool@c3e41da Post-Processor: gcr.io/repo-automation-bots/owlbot-nodejs:latest@sha256:e37a815333a6f3e14d8532efe90cba8aa0d34210f8c0fdbdd9e6a34dcbe51e96 * fix: regular expression matches v1, v1beta1 in order * 🦉 Updates from OwlBot Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com> Co-authored-by: Jeffrey Rennie <rennie@google.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
api: pubsub
Issues related to the Pub/Sub API.
type: bug
Error or flaw in code with unintended results or allowing sub-optimal usage patterns.
Hi!
After a certain event I just want my app to shut down. It seems, though, that gcloud (where I only use pubsub) keeps my App alive. Is there a way to kill pubsub so my App can shut down?
The text was updated successfully, but these errors were encountered: