Skip to content

react-native | Allow invoking a sync callback under AsyncCallback via 'unsafeCallSync'.#43143

Closed
nlutsenko wants to merge 1 commit into
mainfrom
export-D54028850
Closed

react-native | Allow invoking a sync callback under AsyncCallback via 'unsafeCallSync'.#43143
nlutsenko wants to merge 1 commit into
mainfrom
export-D54028850

Conversation

@nlutsenko

Copy link
Copy Markdown
Member

Summary:
AsyncCallback allows storing SyncCallback and invoking it from any thread.
However, there are cases where if you have a mix of sync and async callbacks - you might want to invoke them together in one go, instead of spreading them out across thread invocations.

For those cases - allow invoking any AsyncCallback as a sync one, prefixing it with "unsafe", because it's inherently not a safe operation to perform.

Changelog:
[General][Changed] - Allow invoking the AsyncCallback synchronously to allow for tight performance optimization.

Reviewed By: s-rws

Differential Revision: D54028850

… 'unsafeCallSync'.

Summary:
AsyncCallback allows storing SyncCallback and invoking it from any thread.
However, there are cases where if you have a mix of sync and async callbacks - you might want to invoke them together in one go, instead of spreading them out across thread invocations.

For those cases - allow invoking any AsyncCallback as a sync one, prefixing it with "unsafe", because it's inherently not a safe operation to perform.

Changelog:
[General][Changed] - Allow invoking the AsyncCallback synchronously to allow for tight performance optimization.

Reviewed By: s-rws

Differential Revision: D54028850
@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Feb 22, 2024
@facebook-github-bot

Copy link
Copy Markdown
Contributor

This pull request was exported from Phabricator. Differential Revision: D54028850

@facebook-github-bot

Copy link
Copy Markdown
Contributor

This pull request was exported from Phabricator. Differential Revision: D54028850

nlutsenko added a commit to nlutsenko/react-native that referenced this pull request Feb 22, 2024
… 'unsafeCallSync'. (facebook#43144)

Summary:
Pull Request resolved: facebook#43144

Pull Request resolved: facebook#43143

AsyncCallback allows storing SyncCallback and invoking it from any thread.
However, there are cases where if you have a mix of sync and async callbacks - you might want to invoke them together in one go, instead of spreading them out across thread invocations.

For those cases - allow invoking any AsyncCallback as a sync one, prefixing it with "unsafe", because it's inherently not a safe operation to perform.

Changelog:
[General][Changed] - Allow invoking the AsyncCallback synchronously to allow for tight performance optimization.

Reviewed By: s-rws

Differential Revision: D54028850
@analysis-bot

Copy link
Copy Markdown
Platform Engine Arch Size (bytes) Diff
android hermes arm64-v8a 17,935,055 +4
android hermes armeabi-v7a n/a --
android hermes x86 n/a --
android hermes x86_64 n/a --
android jsc arm64-v8a 21,293,288 +7
android jsc armeabi-v7a n/a --
android jsc x86 n/a --
android jsc x86_64 n/a --

Base commit: a1171f7
Branch: main

@facebook-github-bot facebook-github-bot added the Merged This PR has been merged. label Feb 22, 2024
@facebook-github-bot

Copy link
Copy Markdown
Contributor

This pull request has been merged in 765e542.

@javache javache deleted the export-D54028850 branch February 22, 2024 13:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. fb-exported Merged This PR has been merged. p: Facebook Partner: Facebook Partner

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants