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

Updated to support Vapor 3 #5

Merged
merged 8 commits into from
May 13, 2019
Merged

Updated to support Vapor 3 #5

merged 8 commits into from
May 13, 2019

Conversation

kimdv
Copy link
Contributor

@kimdv kimdv commented May 8, 2019

Solves #4

@kimdv
Copy link
Contributor Author

kimdv commented May 8, 2019

@bygri would you mind review this?
And come with feedback 🚀

@bygri
Copy link
Contributor

bygri commented May 8, 2019

Hi Kim, thanks for taking a stab at this! The essential challenge in moving from Vapor 2 to Vapor 3 is that calling out to wkhtmltopdf is a blocking operation, and we must be careful not to block the event loop. generatePDF() must return a Future<Data> - I'd suggest using NIO's BlockingIOThreadPool.

@kimdv
Copy link
Contributor Author

kimdv commented May 9, 2019

Thanks for the fast feedback @bygri !

I have tried what you suggested, hope it is in the right direction! 🚀

Copy link
Contributor

@bygri bygri left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Much better. I have a couple of further comments, plus update the Readme, and then I think it's good to go.

Package.resolved Outdated Show resolved Hide resolved
Package.swift Outdated Show resolved Hide resolved
Sources/wkhtmltopdf/Document+Generate.swift Outdated Show resolved Hide resolved
Sources/wkhtmltopdf/Document+Generate.swift Outdated Show resolved Hide resolved
Sources/wkhtmltopdf/Document.swift Outdated Show resolved Hide resolved
@kimdv kimdv marked this pull request as ready for review May 10, 2019 05:49

Add the following in your `Package.swift` file
```Swift
.package(url: "https://github.com/vapor-community/wkhtmltopdf.git", from: "2.0.0"),
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bygri I have added this, and assumed next release will be 2.0.0 😅

@bygri bygri merged commit 454a8a1 into vapor-community:master May 13, 2019
@bygri bygri mentioned this pull request May 13, 2019
@kimdv kimdv deleted the kimdv/Vapor-3 branch May 21, 2019 07:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants