You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I would like to allow connector authors to use async functions instead of the current callback style.
Acceptance criteria
Define a new contract for connector: a connector provides a flag indicating whether it's callback based or async/promise based. We assume callbacks when the flag is not set (backward compatibility).
All DAO/KVAO methods need to be updated to check what flavor of flow control the connector support and invoke connector methods accordingly. Ideally, there should be a shared helper taking care of implementation details of consuming callback or promise style connectors.
Rework Connector and SqlConnector classes provided by loopback-connector to use async functions instead of callbacks everywhere. This is a semver-major change.
Rework the documentation for connector authors to use async functions instead of callbacks.
Add a new DataSource method execute that supports dual callback/promise API and under the hood calls connector's execute method using the correct style (callback/promise) as provided by the connector. EDIT: The method was already added by feat: dataSource.execute(cmd, args, opts) #1671, now we need to update it to support async execute provided by the connector.
Out of scope
Eventually we should update all of our connectors to use the new major version of loopback-connector and switch to async functions. There should be follow-up issues opened (one per the connector repository). Note that connectors using async functions become incompatible with LB 3.x projects (because they don't support connectors exporting async functions), the upgrade must be released as semver-major.
The text was updated successfully, but these errors were encountered:
@markdirish, thanks for your interest in this GH issue, per the google group discussion. Marking this as "community contribution" as GH doesn't allow me to assign this task to you. Thanks!
I would like to allow connector authors to use async functions instead of the current callback style.
Acceptance criteria
execute
that supports dual callback/promise API and under the hood calls connector'sexecute
method using the correct style (callback/promise) as provided by the connector. EDIT: The method was already added by feat: dataSource.execute(cmd, args, opts) #1671, now we need to update it to support async execute provided by the connector.Out of scope
Eventually we should update all of our connectors to use the new major version of loopback-connector and switch to async functions. There should be follow-up issues opened (one per the connector repository). Note that connectors using async functions become incompatible with LB 3.x projects (because they don't support connectors exporting async functions), the upgrade must be released as semver-major.
The text was updated successfully, but these errors were encountered: