@RequestMapping(value = "/endpoint", method = RequestMethod.POST)
public ResponseEntity<?> endpoint(@RequestBody final ObjectNode data, final HttpServletRequest request) {
somefunction();
return new ResponseEntity<>(HttpStatus.OK);
}
public somefunction() {
.....
}
Trong bộ điều khiển lò xo Java, tôi có điểm cuối. Khi điểm cuối này được gọi, tôi muốn nó quay trở lại trực tiếp, không đợi somefunction()
để kết thúc. Bất cứ ai có thể dạy tôi làm thế nào để đối phó với điều này?Làm thế nào để làm cho Java gọi lại api gọi lại ngay lập tức không chờ đợi?
bắt đầu 'somefunction()' trên khác 'thread' – Jerry06
RxJava được sử dụng cho điều đó – xenteros