-
Notifications
You must be signed in to change notification settings - Fork 2
Open
Labels
help wantedExtra attention is neededExtra attention is neededled signfor code related to the led signfor code related to the led signprintingfor code related to printingfor code related to printingrayquazafor a project thats really coolfor a project thats really cool
Description
When Quasar is running in production, we assume the printer(s)/LED sign is at a certain IP address and forward requests to it, no questions asked. This risks having a request be forwarded to a non existent device and then the SQS message deleted meaning we cannot recover the failed request.
The ping command can be used to check if a device is up at a certain IP address. To run the ping command from Node, we can use exec. An example is below:
const { exec } = require('child_process');
exec('ping <ip address>', function(error, stdout, stderr) {
// do something with error, stdout, stderr
});If you're unfamiliar with ping, check out this animated YouTube video.
Some things to consider
- How do we know when the device is up/down?
- hint: observe how the three callback function params (error, stdout, stderr) change depending on device status
pingnormally "pings" an IP address until stopped. how do we specify only a limited number of packets?
Ideal workflow
- watch the youtube video
- address the above section on things to consider
- create a function in a separate file that makes use of
execto ping a device- The function should return a promise, resolving true/false depending if the device is up or not.
- If you're unfamiliar with Promises, check out this simple video.
- incorporate your new function into the LED/Print handlers.
Metadata
Metadata
Assignees
Labels
help wantedExtra attention is neededExtra attention is neededled signfor code related to the led signfor code related to the led signprintingfor code related to printingfor code related to printingrayquazafor a project thats really coolfor a project thats really cool