How to batch process async queries within 500ms

I have a deep model and want users’ queries between 500ms to be collected in a queue/list, then be sent to the model in batch. I don’t know how to realize it in Sanic?

You could probably use an observer and then a timed event that is attached to the loop, but that might be problematic with multiple workers.