Skip to content

DOCSP-48153: Add sync vs. async content to migration page #241

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

Merged
merged 8 commits into from
Apr 3, 2025

Conversation

mcmorisi
Copy link
Collaborator

@mcmorisi mcmorisi commented Apr 2, 2025

Pull Request Info

PR Reviewing Guidelines

JIRA - https://jira.mongodb.org/browse/DOCSP-48153

Staging Links

  • reference/compatibility
  • reference/migration
  • Self-Review Checklist

    • Is this free of any warnings or errors in the RST?
    • Did you run a spell-check?
    • Did you run a grammar-check?
    • Are all the links working?
    • Are the facets and meta keywords accurate?

    Copy link

    netlify bot commented Apr 2, 2025

    Deploy Preview for docs-pymongo ready!

    Name Link
    🔨 Latest commit b5474f9
    🔍 Latest deploy log https://app.netlify.com/sites/docs-pymongo/deploys/67eeccb85084a50008f6f74f
    😎 Deploy Preview https://deploy-preview-241--docs-pymongo.netlify.app
    📱 Preview on mobile
    Toggle QR Code...

    QR Code

    Use your smartphone camera to open QR code link.

    To edit notification comments on pull requests, go to your Netlify site configuration.


    * - ``find_one_and_replace()``
    - .. code-block:: python
    Asynchronous Methods
    Copy link
    Collaborator Author

    Choose a reason for hiding this comment

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

    Note to tech reviewer – I cut this section down to just a link because I don't know if it makes sense to have two different sources of truth for async methods.

    Copy link
    Collaborator

    @stephmarie17 stephmarie17 left a comment

    Choose a reason for hiding this comment

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

    Nice work! A few questions and suggestions.

    @mcmorisi mcmorisi requested a review from stephmarie17 April 3, 2025 13:35
    Copy link
    Collaborator

    @stephmarie17 stephmarie17 left a comment

    Choose a reason for hiding this comment

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

    LGTM with some tiny suggestions!

    @mcmorisi mcmorisi requested a review from NoahStapp April 3, 2025 16:48
    {+driver-async+} driver. This is due to the {+driver-async+} driver using the native
    ``asyncio`` library instead of thread-based executors.

    Users experiencing performance slowdown should consider using synchronous {+driver-short+}

    Choose a reason for hiding this comment

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

    We should call out that users should first identify if they actually need to be using asynchronous Python here, or if their use case is better served by the synchronous API.

    Copy link
    Collaborator Author

    Choose a reason for hiding this comment

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

    Can take a stab at this in the next revision.

    @mcmorisi mcmorisi requested a review from NoahStapp April 3, 2025 17:18
    Copy link

    @NoahStapp NoahStapp left a comment

    Choose a reason for hiding this comment

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

    Tiny wording change suggestions for clarity, otherwise looks good!

    @@ -113,10 +113,15 @@ The following Motor method signatures behave differently in the {+driver-async+}

    Motor users may experience a degradation of performance when switching to the
    {+driver-async+} driver. This is due to the {+driver-async+} driver using the native

    Choose a reason for hiding this comment

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

    Suggested change
    {+driver-async+} driver. This is due to the {+driver-async+} driver using the native
    {+driver-async+} driver. This is due to the {+driver-async+} driver using native


    Users experiencing performance slowdown should consider using synchronous {+driver-short+}
    with ``async.loop.run_in_executor()`` for asynchronous compatibility. To learn more, see
    ``asyncio`` library instead of thread-based executors. Thread-based executors

    Choose a reason for hiding this comment

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

    Suggested change
    ``asyncio`` library instead of thread-based executors. Thread-based executors
    ``asyncio`` tasks instead of thread-based executors. Thread-based executors

    @mcmorisi mcmorisi requested a review from NoahStapp April 3, 2025 18:00
    @mcmorisi mcmorisi merged commit 820cdec into mongodb:master Apr 3, 2025
    5 of 6 checks passed
    @mcmorisi mcmorisi deleted the DOCSP-48153-sync-vs-async branch April 3, 2025 18:28
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    None yet
    Projects
    None yet
    Development

    Successfully merging this pull request may close these issues.

    3 participants