nexrender
nexrender copied to clipboard
getJob and resumeJob are practically duplicates
Describe the bug
The two functions in nexrender-api are functionally identical in that they both retrieve a job and wrap them with an event emitter. They default method is GET and the content-type doesn't matter as the request does not have a body and they server always return JSON.
Information about environment
- Which version of nexrender are you using? v1.38.0
- What kind of the setup do you have? server+worker with API
- Are you using pre-built binaries or globally installed npm packages? NPM package
- Which kind (and version) of operating system you are running it in? Any
- Any additional information that might be helpful
Hey @limzykenneth, welcome back! :)
What would be your suggestion about that problem?
Also, I see that the original resumeJob was introduced by you: https://github.com/inlife/nexrender/commit/256b31bb78371c12a30ab5d15017a673c92cd119
Was looking to do some updates recently and came across this.
I would suggest a deprecation message on getJob and make it an alias of resumeJob, although I wanted to add a new method to get a specific job by ID without the event emitter (like listJob but return only one by ID, which I'm doing manually for now) and getJob would be a fitting name for it, I'll need to think of something else.
I'll make a PR for this according to proposal above in the next few days.