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

Refactor AbstractOperation to use an async execute and command method

    • Type: Icon: Task Task
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • 5.7.0
    • Affects Version/s: None
    • Component/s: None
    • Not Needed
    • Hide

      1. What would you like to communicate to the user about this feature?
      2. Would you like the user to see examples of the syntax and/or executable code and its output?
      3. Which versions of the driver/connector does this apply to?

      Show
      1. What would you like to communicate to the user about this feature? 2. Would you like the user to see examples of the syntax and/or executable code and its output? 3. Which versions of the driver/connector does this apply to?

      Use Case

      As a node driver user
      I want the findOperation to use async syntax
      So that the driver is closer to generating async stack traces

      User Impact

      • This is an internal change

      Dependencies

      • None

      Unknowns

      Acceptance Criteria

      Implementation Requirements

      • Add a server.commandAsync wrapper to the Server class
        • Use Connection.commandAsync as a model, i.e. do not refactor command, add a wrapper
      • Add a new AbstractCallbackOperation subclass of AbstractOperation
        • remove executeAsync from AbstractOperation
        • add a new abstract method executeCallback to AbstractCallbackOperation
        • change abstract execute on AbstractOperation to return a promise and no longer take a callback
        • add an implementation of async execute to AbstractCallbackOperation that wraps executeCallback
      • Modify all operations to subclass AbstractCallbackOperation, and rename execute to executeCallback
        • Modify usages of super.execute to super.executeCallback

      Testing Requirements

      • Add a test the server.commandAsync invokes server.command

      Documentation Requirements

      • None

      Follow Up Requirements

      • None

            Assignee:
            malik.javaid@mongodb.com Malik Javaid (Inactive)
            Reporter:
            neal.beeken@mongodb.com Neal Beeken
            Warren James
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: