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

Call API endpoints asynchronously #16

Open
dmitriim opened this issue Apr 16, 2020 · 4 comments
Open

Call API endpoints asynchronously #16

dmitriim opened this issue Apr 16, 2020 · 4 comments
Labels

Comments

@dmitriim
Copy link

dmitriim commented Apr 16, 2020

At some point API end points could be slow. This will slow down Moodle operations related to the configured events.
The solution could be to have a configuration option to run web hooks asynchronously via adhoc tasks or cron task.

@valentineus
Copy link
Owner

Thanks! It's a valuable issue.

I too see this problem. This problem will be to resolve a new version. I'm using adhoc_task to asynchrony work.

@dmitriim
Copy link
Author

Nice!
Would it be possible to make it configurable and let the admin to decide if a webhook should be processed real time or by adhoc?
Also would be useful to fall back to adhoc if for some reason the webhook failed during real-time execution.

@mlohoar
Copy link

mlohoar commented Sep 7, 2022

I agree that this should definitely be a setting for using adhoc or not. Otherwise you might get into race conditions between Moodle and the external service.

@vtos
Copy link

vtos commented Apr 19, 2023

My point is it must always be a background task, I mean making those calls. The event handler should just make up a queue of those API calls and store it, and a worker should be running to make the calls actually. This will also allow for having a retry flow in case an API call failed (which is super-highly possible).

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

No branches or pull requests

4 participants