daily-demos / ai-meeting-assistant

https://daily-ai-assistant-demo.vercel.app
BSD 2-Clause "Simplified" License
8 stars 2 forks source link

Lock lists to avoid read/writing from different thread, and run OpenAI requests in thread pool executor #11

Closed lazeratops closed 8 months ago

lazeratops commented 8 months ago

This PR adds locks to collections that have a chance of being read and written from different threads at the same time.

Note that this is a simplistic approach for the purpose of the demo; if we want to be fancy we probably want to implement RW locks, but if desired that can be done as a followup to this PR. If optimizing, we might also consider investigating whether it makes sense to batch context updates to avoid potential for many locks while repeatedly updating and querying in close succession.

This PR also runs OpenAI requests in separate threads to avoid blocking the main thread.

vercel[bot] commented 8 months ago

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
daily-ai-assistant-demo ✅ Ready (Inspect) Visit Preview 💬 Add feedback Dec 11, 2023 0:58am