I have records coming in that have to be processed sequentially.
Records R1 and R2 come in over the REST API to my Appery backend service.
So if R1 is being processed and R2 arrives, I don't want R2 to be processed. What to do with R2 depends on results of R1. Oh, and processing R1 results in DB writes and REST calls, etc. that will relinquish the CPU to let R2 run.
Normally these are well spaced in time that it doesn't matter. But sometimes they are back-to-back.
Is there a semaphore strategy on Appery server code? Like static variables for the server code?