Async Job Notification Service #5445
AllanOricil
started this conversation in
Ideas
Replies: 2 comments
-
A solution for a problem that this other feature can't solve. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Problem
There are several vscode commands which can be run sync or async. When running commands async, there is currently no way to invoke a callback function to perform an action, like notifying the User that the command is over. This means that developers have to manually pool the job status. The same issue also happens in sf/sfdx cli. So, by removing this manual work, I believe that DX would be improved. And I have a solution for this problem.
Solution
When developers use any of those async commands, the resulting job uuid is sent to a service which I call "Async Job Notification Service" (AJNS). This service runs in VS Code, in the background, and its only responsibility is to automatically pool Job information every N amount of time. While AJNS's set has Ids, it keeps pooling job information until the job is over. When a response containing a terminal state is received, AJNS dispatches a VS Code notification, or it could also be a native OS notification when VS Code is not visible.
Flow
The service implementation can be a fastify/express server that starts whenever its extension layer identifies an sfdx project in cwd. Similar to what the Prettier extension does.
AJNS could also solve sf/sfdx cli problem
whenever an sf/sfdx cli async command gets the unique job id, it pushes this Id to AJNS if (POST localhost:XXXX), if one is running.
@mshanemc
Beta Was this translation helpful? Give feedback.
All reactions