Skip to content
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

BasePrinter Dispose() method block printing #218

Open
emanuhell opened this issue Jan 23, 2023 · 2 comments
Open

BasePrinter Dispose() method block printing #218

emanuhell opened this issue Jan 23, 2023 · 2 comments

Comments

@emanuhell
Copy link

emanuhell commented Jan 23, 2023

BasePrinter Dispose() method block printing. For example:

printer.Write(e.Initialize());
printer.Write(e.Enable());
printer.Write(Tests.Receipt(e));
printer.Dispose();

prints nothing!
I need the Dispose method to release the connection to the printer after each print, to allow other running applications to use the same printer.
Thanks.

@emanuhell emanuhell changed the title Baseprinter Dispose() method block printing BasePrinter Dispose() method block printing Jan 23, 2023
@lukevp
Copy link
Owner

lukevp commented Jan 27, 2023

Which printer are you using? Some of the implementations are asynchronous (Writes are buffered and flushed by a task). This is to increase the performance of many small writes. You may just be disposing the connection before the flush happens. We should probably expose a way to await the print queue being empty.

@emanuhell
Copy link
Author

Which printer are you using?
I'm using the SerialPrinter.

We should probably expose a way to await the print queue being empty.
What method are you talking about? I can't find it.

Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants