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

Convert DefaultExternalServices.fallback to an asynchronous method #12800

Conversation

Snuffleupagus
Copy link
Collaborator

This method currently accepts a callback-function, which does feel a bit old fashioned now. At the time that this code was introduced, native Promises didn't exist yet and there's a custom Promise-implementation used instead.

However, today with Promises and async/await being used a lot it seems reasonable to change DefaultExternalServices.fallback to an async method instead such that the callback-function can be removed.

This method currently accepts a callback-function, which does feel a bit old fashioned now. At the time that this code was introduced, native Promises didn't exist yet and there's a custom Promise-implementation used instead.

However, today with Promises and async/await being used *a lot* it seems reasonable to change `DefaultExternalServices.fallback` to an `async` method instead such that the callback-function can be removed.
@Snuffleupagus
Copy link
Collaborator Author

/botio-linux preview

@pdfjsbot
Copy link

From: Bot.io (Linux m4)


Received

Command cmd_preview from @Snuffleupagus received. Current queue size: 0

Live output at: http://54.67.70.0:8877/78f8bef6f4dd6f7/output.txt

@pdfjsbot
Copy link

From: Bot.io (Linux m4)


Success

Full output at http://54.67.70.0:8877/78f8bef6f4dd6f7/output.txt

Total script time: 4.02 mins

Published

@timvandermeij timvandermeij merged commit f305e04 into mozilla:master Dec 31, 2020
@timvandermeij
Copy link
Contributor

Looks much better. Thanks!

@Snuffleupagus Snuffleupagus deleted the DefaultExternalServices-async-fallback branch December 31, 2020 12:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants