FastAPI: How to Process Incoming Requests in Batches

Ng Wai Foong
Level Up Coding
Published in
5 min readNov 17, 2020

--

Utilizing WebSockets, Queue and APScheduler for batch processing in FastAPI

Photo by Mihály Köles on Unsplash

In this tutorial, I am going to share a simple experiment that I have conducted over the weekend. The basic idea is to queue up all the incoming requests and process them in batches at certain interval each time. To do so, we are going to

  1. establish two-way connections…

--

--

Senior AI Engineer@Yoozoo | Content Writer #NLP #datascience #programming #machinelearning | Linkedin: https://www.linkedin.com/in/wai-foong-ng-694619185/