I have a resource (r) with two non-blocking operations (this is from external library that I cannot change):
Mono<String> op1(String someInput);
Mono<String> op2(String otherInput);
op1() and op2() can be called over different threads but cannot execute concurrently. When op1 is called depends upon external factors, same is true about op2. Two operations are unrelated(op1 may be called 100 times and op2 1 times). How to ensure mutually exclusive processing of op1 and op2. If op1 /op2 were blocking, java 'synchronized' would have solved it. External library methods fail if the op1 and op2 processing happens simulataneously.
How to enforce such synchronization without using EmitProcessor(which is deprecated) so that op1 and op2 can be called from different Scheduler threads? or is there a built-in standard solution in WebFlux api to address such scenarios?
(There is a solution using EventProcessor but want to avoid it as EventProcessor is deprecated Nonblocking ReentrantLock with Reactor)