Repository ini menampung hasil pengerjaan untuk menyelesaikan study case async API. Dibuat oleh kelompok 2 kelas 3B mata kuliah Pengembangan Web, JTK Polban.
You are developing an application where there is long running process on some endpoints. The process could take up to minutes or even hours.
Due to the long processing time, there is a possibility that a timeout or memory leak might occur within the application, or on the client side.
Process Request
|
x minutes/hours x-------x timeout
|
Finished Response
You need to implement a mechanism, where the process could run in parallel, and the client is not required to wait for the response, but could fetch it another time.
Process Request ----> Result Request ----> Result Request
| | |
x seconds x seconds x seconds
| | |
Accepted Response Unfinished Response Finished Response
(repeat)
You could also implements Signaling or PubSub mechanism to achieve this.
Process Request
|
x seconds
|
Accepted Response
--- --- ---
Finished Signal -------------> Result Request
|
x seconds
|
Finished Response
The long running API main call is now could responds within seconds, and the response could be fetched another time in the future.
- Kami telah mengimplementasikan Async API pada study case kami dengan mekanisme Polling Model
- Ketika /start, program akan generate dan segera menampilkan processId. Lalu ketika /poll/{processId}, jika program belum selesai generate randomUUID sejumlah yang dituliskan pada code, maka program akan mengeluarkan status "Sedang Diproses...".
- Kami telah mendeploy hasil pekerjaan kami ke dalam Virtual Machine.