camaraproject / RegionDeviceCount

Repository to describe, develop, document and test the RegionDeviceCount API family
Apache License 2.0
2 stars 2 forks source link

Add capability for async response behaviour. #37

Open bigludo7 opened 1 week ago

bigludo7 commented 1 week ago

Problem description The standard behavior of the API is synchronous, although for large area requests the API may behave asynchronously

Possible evolution An API invoquer can enforce asynchronous behavior by providing a callback URL (sink) is in the request, in this case the API sends a callback to the callback URL provided with the result of the request. Additionally response code 202 should be added.

Alternative solution

Additional context This is a pattern already provided in Population Density Data API and make sense to replicate it. It means that we add in the request sink attribute & sinkCredential object.

chinaunicomyangfan commented 2 days ago

@bigludo7 A great suggestion. For larger areas, the statistical time may indeed be longer. Introducing asynchronous interfaces is a good solution, and the Population Density Data API provides a great implementation. I will refer to and add this feature to our API

bigludo7 commented 2 days ago

Thanks @chinaunicomyangfan !! :)