Limit number of incoming requests

What is the best way to limit the number of concurrent requests each sanic worker is working on?
Something similar to uvicorn’s --limit-concurrency

I would create maybe a semaphore on the app context, then decrement it in a signal handler (Event.HTTP_LIFECYCLE_REQUEST)

LMK if you want me to share a snippet.

You could do something similar with connections too, just on an earlier signal event.

Sorry to raise an old question here but if happen to recall that snippet I would be interested in seeing it.