I'm developing an activity module which has to access an external web service (REST API) after its initial instance creation. In other words, when the teacher submits the `mod_form.php`, the plugin should access the web service to transform some data.
I initially thought about doing it inside `pluginname_add_instance($data)` from `lib.php` but I'm not sure this is the correct place.
Is there any good practice in Moodle to do this kind of asynchronous tasks?
Thanks for your help!