mirror of
https://github.com/PrefectHQ/fastmcp.git
synced 2026-08-21 21:14:17 +02:00
Document why an in-process lock is sufficient
This commit is contained in:
parent
d639ce9297
commit
c8eb7617ef
1 changed files with 7 additions and 0 deletions
|
|
@ -89,6 +89,13 @@ class EventStore(SDKEventStore):
|
|||
# for the whole store rather than one per stream: the critical section is
|
||||
# two short key-value calls, and per-stream locks would need their own
|
||||
# eviction to avoid growing with every session.
|
||||
#
|
||||
# An in-process lock is enough because a stream list only ever has
|
||||
# in-process writers: every transport gets its own SessionScopedEventStore
|
||||
# with a random per-session prefix, so no two servers sharing one backend
|
||||
# address the same stream key. Coordinating across processes would need a
|
||||
# compare-and-swap or transactional update, which AsyncKeyValue does not
|
||||
# expose -- it offers only get/put/delete/ttl.
|
||||
self._stream_lock = asyncio.Lock()
|
||||
|
||||
# PydanticAdapter for type-safe storage (following OAuth proxy pattern)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue