-
Notifications
You must be signed in to change notification settings - Fork 10.2k
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
Small clean-up of the PDFDocumentProxy.destroy
method and related code
#10636
Small clean-up of the PDFDocumentProxy.destroy
method and related code
#10636
Conversation
2aea735
to
aa75bb6
Compare
From: Bot.io (Linux m4)ReceivedCommand cmd_test from @Snuffleupagus received. Current queue size: 0 Live output at: http://54.67.70.0:8877/f89697cc3f2ebf5/output.txt |
From: Bot.io (Windows)ReceivedCommand cmd_test from @Snuffleupagus received. Current queue size: 0 Live output at: http://54.215.176.217:8877/cf2b607fc8f9d3b/output.txt |
From: Bot.io (Linux m4)SuccessFull output at http://54.67.70.0:8877/f89697cc3f2ebf5/output.txt Total script time: 18.00 mins
|
From: Bot.io (Windows)SuccessFull output at http://54.215.176.217:8877/cf2b607fc8f9d3b/output.txt Total script time: 25.73 mins
|
It looks like this proxy is exposed in the API, so should this change be marked as |
Sorry, I'm slightly confused as to which proxy you're referring to here? Ninja-edit: Are you worried that users may be relying the When calling How about just adding a |
8d030be
to
028f80d
Compare
Note how `PDFDocumentProxy.destroy` is a nothing more than an alias for `PDFDocumentLoadingTask.destroy`. While removing the latter method would be a breaking API change, there's still room for at least some clean-up here. The main changes in this patch are: - Stop providing a `PDFDocumentLoadingTask` instance *separately* when creating a `PDFDocumentProxy`, since the loadingTask is already available through the `WorkerTransport` instance. - Stop tracking the `PDFDocumentProxy` instance on the `WorkerTransport`, since that property is completely unused. - Simplify the 'Multiple `getDocument` instances' unit-tests by only destroying *once*, rather than twice, for each document.
028f80d
to
24fc4f8
Compare
From: Bot.io (Linux m4)ReceivedCommand cmd_test from @Snuffleupagus received. Current queue size: 0 Live output at: http://54.67.70.0:8877/dfb5130cd0b5cda/output.txt |
From: Bot.io (Windows)ReceivedCommand cmd_test from @Snuffleupagus received. Current queue size: 0 Live output at: http://54.215.176.217:8877/b80de72fd2e597d/output.txt |
From: Bot.io (Linux m4)SuccessFull output at http://54.67.70.0:8877/dfb5130cd0b5cda/output.txt Total script time: 17.86 mins
|
From: Bot.io (Windows)SuccessFull output at http://54.215.176.217:8877/b80de72fd2e597d/output.txt Total script time: 25.74 mins
|
Yes, that was what I was thinking about.
I'm now actually questioning if we need to do that, given that we also remove the On the other hand, I don't think we actually documented/advertised using those properties of the document proxy, so I'm not sure if it actually qualifies as an API change. What do you think about this? |
But that's on the The reason for wanting to keep a way to go from |
You're completely right; I overlooked that part. I took another look and I'm now also convinced that this is the right approach. Thank you! |
Note how
PDFDocumentProxy.destroy
is a nothing more than an alias forPDFDocumentLoadingTask.destroy
. While removing the latter method would be a breaking API change, there's still room for at least some clean-up here.The main changes in this patch are:
PDFDocumentLoadingTask
instance separately when creating aPDFDocumentProxy
, since the loadingTask is already available through theWorkerTransport
instance.PDFDocumentProxy
instance on theWorkerTransport
, since that property is completely unused.getDocument
instances' unit-tests by only destroying once, rather than twice, for each document.