-
-
Notifications
You must be signed in to change notification settings - Fork 182
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
Clean up object disposal and shutdown long running tasks. #143
base: master
Are you sure you want to change the base?
Conversation
Add Standard Mode Operational Command.
Hi @hollandar glad you like the library! This PR is too big and impactful to merge without some significant review and discussion. Part of the changes introduced in 2.0 were to allow the network printer to manage connectivity automatically, for example, but this PR reintroduces the concept of manually having to connect. So I don't think this PR matches with my philosophy of an ESCPOS object = a connection to a printer and the library hides the intricacies behind that from you. Did you attempt to update the dispose logic to properly dispose of objects instead of changing the connection management? Do you have a test case that easily shows this disposal issue? Having said that, this PR and #130 both address the implications of the 2.0 changes, so I do see this as a problem and I'd love to fix it, but I think it makes sense for the library to manage connectivity and monitoring automatically for the end user so I'd rather fix it via properly managing and disposing rather than requiring some additional interaction with the library to manage the connection lifecycle manually. Could you make a separate PR with the escpos protocol changes? That one I can merge with little review, and we can iterate on this PR instead. |
Thanks Luke, I'll enumerate the problems we found as a way to start discussing how to address the issues.
I dealt with these by:
I hear you on the 2.0 changes; but unsure how you address it. This PR surfaces the NetworkPrinter failure on the first time around, and subsequently reconnects after disconnections with a timeout; not silently and not forever. In our testing so far handling the disconnected event has been enough to keep the printer connected; are there scenarios you were addressing in 2.0 that this approach didn't address?? I did attempt to stop attemptreconnectindefinitely from occurring on disposal by exposing the write cancellation token to NetworkPrinter but this didn't feel right. Adrian. |
Hi @hollandar I am incorporating the lib into an enterprise app and I've faced all the problems you are mentioning. While this lib by @lukevp is a great starting point it cannot be used in production environments without addressing theses issues first. Should I head over to your repo and maybe contribute there? Are you actively developing this? Thanks |
Hey John,
We are running the version in my fork in production on Linux with test environments on Linux and Windows.
Our printers are TM-20’s so I have not extensively tested the straight serial components on Linux, primarily TCP.
Since we are running my fork in prod, happy to take PR’s on it; we will come back around to it in a second pass later this year.
Cheers,
Adrian.
|
I'm also using TCP and mixing EPSON with CITIZEN printers. If anything comes up I'll write/ping you on your repo |
@hollandar I think something went south with your recent comment, may want to clean it up. :) @jkatsiotis, I hear you on these issues. I'm sorry it's causing you trouble. I've had a lot going on personally/professionally in the past few months, but I want to continue to support this library. I'll set some time aside this month to review all open PRs, incorporate changes where it makes sense, and cut a new release. I think the 2.0 move to persistent connections was not an ideal solution based on the issues that have come in. Sounds like you can use @hollandar 's fork for now but I hope I can win you back to the OG repo once these changes have been made. Just as a general note, I don't use this library myself in production, so I'm super appreciative of the PR and the contributions. I just need to make sure they all work together in a sensible way as there are multiple competing philosophies on how the library should function, so I have to conform these to ensure the overall project goals are maintained. I think we're getting enough users that there should be a roadmap of future work and changes that would really help everyone get aligned on where this lib is going. I'll do that as well. |
Hi,
This PR makes changes to the base printer object, and the serial and network variants, and to the Esc-Pos protocol.
We have been integrating this on dotnet core across multiple platforms, and had a few challenges.
Base Printer
EscPos protocol.
Thanks for your component, it works with Epson printers nicely.
Adrian