Skip to content

limit queue size to 10 images for realtime processing - #390

Open
ralph-sj wants to merge 4 commits into
mainfrom
process-realtime-without-backlog
Open

limit queue size to 10 images for realtime processing#390
ralph-sj wants to merge 4 commits into
mainfrom
process-realtime-without-backlog

Conversation

@ralph-sj

Copy link
Copy Markdown
Collaborator

Limit the queue size to 10 and remove old images if the queue exceeds this. This skips images and removes backlogs in the realtime processing where processing takes much longer than acquisition.

@animmosmith

Copy link
Copy Markdown
Collaborator

One suggestion: deque(maxlen=10) (line 48) hard-codes the retained queue size. Since the right value depends on acquisition rate vs. processing throughput — which is hardware/instrument-dependent — could we make this configurable instead of fixed at 10? E.g. thread a queue_size: int = 10 parameter through run_realtime() and expose it as --queue-size on the process-realtime CLI command, the same way watch_folder is already exposed. Default of 10 would keep current behavior unchanged for everyone else.

Worth a one-line docstring/help note too: a bigger queue just delays which images get dropped when processing can't keep up — it doesn't fix the underlying backlog — so users don't mistake it for a throughput setting.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants