-
-
Notifications
You must be signed in to change notification settings - Fork 21
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
Converting in gofuncs failed #3
Comments
@shaikemarc The package itself should be thread safe. However, wkhtmltox does not seem to support multithreading. Relevant links: wkhtmltopdf/wkhtmltopdf#1711 I will try to find a solution to this issue, as running multiple converters concurrently is a common use case. |
@adrg thanks for that! |
Please, also refer to: https://github.com/leandrosilva/go-wkhtmltopdf/blob/master/examples/ex2 Thanks! |
@leandrosilva @shaikemarc I got a bit of free time and I thought I should give this issue a go. I managed to get it to work by running the conversion on the main thread. I added a Web page to PDF conversion server example to showcase this. Would you be able to try the example and let me know if it works for you as well? |
As per my tests, yes, it has worked. Including the case with "window status". I've been playing with wkhtmltox in other languages for awhile now (C++/Rust/Python/C#) and faced this "main thread" kind of problem many times until finally understand what happens. This thread covers this topic quit well: Thanks for sharing your code. |
I added https://github.com/leandrosilva/go-wkhtmltopdf/blob/master/examples/use-of-http-handler/main.go Many thanks. I didn't know this method. |
@leandrosilva That's great, I'm glad it worked for you as well. That means this issue can be closed. |
@leandrosilva I added a couple of improvement in PR #6, including JSON/YAML marshal support for the conversion options. That should make it easier to parse HTTP conversion requests. Also added a Configurable web page to PDF conversion server example. |
That's cool. |
BTW, not sure whether it happens to you but I got "could not set converter option |
I just did that: #7 |
@leandrosilva Hm, I don't have the |
@adrg I'm using |
From what I can tell, the default has always been 4. The problem with |
@leandrosilva I created a Discord channel so that issues like this one can be discussed in depth, or where users of the package can get support, etc. I added an invite link in |
I tried to spawn x gofuncs, each created a converter but failed on access violation. Is this library safe for a concurrency use?
Thanks
The text was updated successfully, but these errors were encountered: