Uploaded image for project: 'Node.js Driver'
  1. Node.js Driver
  2. NODE-5614

add support for explicit resource management in the Node driver

    • 3
    • Not Needed
    • Needed
    • Hide

      1. What would you like to communicate to the user about this feature?
      The node driver now experimentally supports explicit resource management (https://github.com/tc39/proposal-explicit-resource-management). We should document how to use the new feature and common pitfalls to users.

      2. Would you like the user to see examples of the syntax and/or executable code and its output?

      We’d like example of the new `using` syntax with the driver, yes.

      3. Which versions of the driver/connector does this apply to?
      6.9.0 and above.

      Show
      1. What would you like to communicate to the user about this feature? The node driver now experimentally supports explicit resource management ( https://github.com/tc39/proposal-explicit-resource-management ). We should document how to use the new feature and common pitfalls to users. 2. Would you like the user to see examples of the syntax and/or executable code and its output? We’d like example of the new `using` syntax with the driver, yes. 3. Which versions of the driver/connector does this apply to? 6.9.0 and above.

      Use Case

      As a user of the Node driver,
      I want the Node driver to support async resource management,
      So that so that I can use the explicit resource management proposal without workarounds.

      Background

      Ecmascript has moved explicit resource management to stage 3, and now major runtimes and bundlers are adding support for the helpers (examples include Nodejs, webpack, and Typescript).

      Acceptance Criteria

      POC containing runtime and TS logic, but no tests: https://github.com/mongodb/node-mongodb-native/pull/4177

      • Add support for explicit resource management to all public driver constructs that have associated asynchronous cleanup logic:
        • MongoClient
        • Cursors
        • ChangeStreams
        • Sessions
      • Configure API extractor to generate a `beta` namespace and mark all resource management interfaces and functions beta.

      Testing

      • Add smoke tests that compile the driver with resource management and confirm users can use async disposal semantics with the driver's resources
      • Ensure all existing drivers tests pass.
      • Add tests that confirm async resource management disposal methods call each resources' disposal methods.
      • Add tests that ensure when the symbol is not defined, no disposal methods are added to driver resources.

      Documentation Requirements

      • File a ticket to have a reference manual page added to the Node driver reference docs demonstrating how to use explicit resource management with the Node driver

            Assignee:
            bailey.pearson@mongodb.com Bailey Pearson
            Reporter:
            bailey.pearson@mongodb.com Bailey Pearson
            Neal Beeken
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated:
              Resolved: