Skip to content

Instantly share code, notes, and snippets.

@cjus
Created July 25, 2018 00:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cjus/e17b27aabf4bd9ecca42d75f16fc9638 to your computer and use it in GitHub Desktop.
Save cjus/e17b27aabf4bd9ecca42d75f16fc9638 to your computer and use it in GitHub Desktop.
Message processing snipit
async checkForTasks(callback) {
let message;
try {
message = await this.hydra.getQueuedMessage(this.serviceName);
} catch (e) {
this.logger('fatal', e);
return;
}
// message processing code lines deleted here...
setTimeout(async () => {
await this.checkForTasks(callback);
}, this.messageCheckDelay);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment