SQSWatcher#
- class langchain_mongodb_deepagents_vfs.watcher.sqs.SQSWatcher(store: ObjectStoreBackend, chunker: Chunker, embedder: Embedder, collection: Collection, queue_url: str, region_name: str | None = None, visibility_timeout: int = 120, endpoint_url: str | None = None, prefix: str = '')[source]#
Event-driven watcher backed by an SQS queue of S3 event notifications.
- Parameters:
store (ObjectStoreBackend) โ Object store backend.
chunker (Chunker) โ Chunker instance.
embedder (Embedder) โ Embedder instance.
collection (Collection) โ MongoDB collection.
queue_url (str) โ Full SQS queue URL.
region_name (str | None) โ AWS region.
visibility_timeout (int) โ How long (seconds) a received message stays invisible to other consumers while being processed.
endpoint_url (str | None) โ Override for local testing (e.g. LocalStack).
prefix (str) โ Only ingest keys under this S3 prefix. Events for keys outside it are discarded, so a queue subscribed to a whole shared bucket cannot pull out-of-scope objects into the search index.
Methods
__init__(store,ย chunker,ย embedder,ย ...[,ย ...])on_created(key)Handle a new object in S3.
on_deleted(key)Handle a deleted object โ remove all its chunks from MongoDB.
on_updated(key)Handle an updated object in S3.
start()Start the watcher in a background daemon thread.
stop()Signal the watcher to stop and join the background thread.
- __init__(store: ObjectStoreBackend, chunker: Chunker, embedder: Embedder, collection: Collection, queue_url: str, region_name: str | None = None, visibility_timeout: int = 120, endpoint_url: str | None = None, prefix: str = '') None[source]#
- Parameters:
store (ObjectStoreBackend)
chunker (Chunker)
embedder (Embedder)
collection (Collection)
queue_url (str)
region_name (str | None)
visibility_timeout (int)
endpoint_url (str | None)
prefix (str)
- Return type:
None
- on_created(key: str) None#
Handle a new object in S3.
- Parameters:
key (str)
- Return type:
None
- on_deleted(key: str) None#
Handle a deleted object โ remove all its chunks from MongoDB.
- Parameters:
key (str)
- Return type:
None
- on_updated(key: str) None#
Handle an updated object in S3.
- Parameters:
key (str)
- Return type:
None