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
Adding a isComplete function #12 #13
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @ppivanov, thank you very much for the contribution. i would love to see this functionality in master, and i have just a few small comments.
hey, I wanted to check if this work is finished. It still says "DO NOT MERGE" |
Hey! Still don't have the hardware to test this functionally. If anyone has gotten a chance to make sure it works I'm all for it. |
A new printer is on its way... Will be able to test this soon 🤞 |
this should be fine now. would have loved someone else giving it a spin in case something obvious was missed |
ca396f8
to
f89a4df
Compare
hi @ppivanov thanks for your work! I have published a beta version readme needs to be updated too |
Why is a loop needed to check for print completion? |
If the job is still on the queue the first time you check (e.g. immediately after it was submitted) you may want to check again after a minute or two have passed. There are probably better polling techniques that won't block the thread. |
Any update on this @artiebits ? |
hi @ppivanov, sorry for such a big delay in reviewing your PR. it looks good to me, and the only comment I have is that the example in readme doesn't look valid to me because it will execute the check 10 times without any delay.
or something like this, which will stop checking If the print job is complete in the first iteration of the loop:
let's keep it simple for now! |
Can a new version be released as soon as this is merged, thanks, great work @artiebits @ppivanov! Really useful library |
thanks @shubhmg, there is a beta version with this change |
@ppivanov thank you for your contribution! I will release a new version today |
* getJobId and isPrintComplete * getJobId tests * extend try-catch * we don't ask questions here * more tests * undo some formatting * deleted some stuff I shouldn't have * tabs to spaces * update index.ts * messed up the exports order (: * a few nits * Undo changes to print fn * remove stale non-null assertions * format with prettier * update tests & remove comments * order * fix condition * fix tests and read stdout as expected * Update parse-response.ts * readme * update readme
I have no idea how much of this works as my printer's been dead for a while, but whoever needs it can test it out and share some feedback or update the branch accordingly.
Updating
print
to return the job id based on what @artiebits commented on #12.Adding
isPrintComplete
to query the queued jobs and will return false if it finds a row matching the job id (I'm very much assuming it should disappear when it completes).Whoever utilizes the package can add custom polling / delays as calling
isPrintComplete
just once immediately afterprint
will likely always return false.Docs will need to be updated if you wanna go through with it