I wish to implement a web api call - a Controller method - that takes a user id and sends out notifications for one or more devices related to that user.
In the Service module, this call will perform 1 asynchronous operation per eligible device.
Because the service operations are asynchronous, there are 2 basic options:
-
I could return a result to the client immediately and allow it to reconnect for the status of the notifications.
-
I could wait until all of the asynchronous operations are complete before returning.
Which it considered "best practice"; the former or the latter?
Aucun commentaire:
Enregistrer un commentaire