Beapi-io / spring-boot-starter-beapi

Springboot 'convention over config' starter for API Automation
Other
1 stars 1 forks source link

Concurrent handling for batching #114

Closed orubel closed 3 months ago

orubel commented 4 months ago

would like to test api batching with concurrent handling

@RestController public class ExampleController { @RequestMapping("/example") public String handleExampleRequest(@RequestParam("param") String param) { Executor executor = Executors.newFixedThreadPool(10); String result = executor.submit(() -> { // Perform some logic here return "Hello, " + param; }).get(); return result; } }

Not that batching is used frequently enough to really impact but I would rather reduce overhead; I believe this might reduce I/O as a result of the FORWARD.

I believe this should enable just running the batch at the function WITHOUT having to even use a FORWARD

orubel commented 3 months ago

apparently I was talking about parallelizing batching; this should NOT be done because a tuple can have foreign key in the same table

For example, COMMENTS can be children/parents of other COMMENTS. Thus parallelizing DELETES/PUTS/POSTS can cause errors if they are not done in a sequential order.

Closing