Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pass reportError to the processTask function #14

Open
EECOLOR opened this issue Oct 13, 2018 · 2 comments
Open

Pass reportError to the processTask function #14

EECOLOR opened this issue Oct 13, 2018 · 2 comments

Comments

@EECOLOR
Copy link
Member

EECOLOR commented Oct 13, 2018

Please vote on this issue if you would like this feature to be added.


This feature request came from #11

Instead of this:

async function processTask(task) {
   try { ... }
   catch (e) { reportError(e); ... }
}

We want to do this:

async function processTask(task, { reportError }) {
   try { ... }
   catch (e) { reportError(e); ... }
}
@geoervin
Copy link

Does passing the function in this way change the default behavior outlined in #11 (comment) ?

@EECOLOR
Copy link
Member Author

EECOLOR commented Oct 13, 2018

@geoervin Great question! No it does not, it is just a simplification.

Instead of passing the reportError to both the queue and processTask function, users of the library just pass it to the queue and have it available in the processTask function if needed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants