Em chào anh, em làm chức năng là gửi notification cho user, ví dụ có 1 event thì phía server phải gửi 1 loạt HTTP restful tới từng client riêng biệt, có cách nào để gửi cả cụm được k ạ
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Hơi khó hiểu, bởi vì theo kiến trúc Rest thì server sẽ không lưu trạng thái của client, vì vậy thông thường khi có 1 request thì server sẽ có 1 response trả lại luôn. (Timeout cao nhất là 90s, thường là vậy)
Chính vì vậy sẽ không có việc Server chủ động gửi data cho client.
Ví dụ 1 trường hợp Call APi request yêu cầu thực hiện công việc nào đó và kết quả sẽ có trong tương lai (Chạy job jenkins).
Thì với Rest sẽ trả về response với Header có chứa thông tin tới Link của job để chúng ta call kiểm tra trạng thái và thông tin.