RpcClient: bounded notification buffer with overflow policy #5
Labels
No labels
area:assertions
area:cli
area:client
area:harness
area:meta
area:reporting
area:runner
type:user-story
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
charles/ws-rpc-test#5
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
User story
As a test author, I want events that arrive before I call
wait_forto still be observable, so that my tests don't race the server.Acceptance criteria
idpresent → response routing (handled in the request/response issue).id→ notification.VecDeque<NotificationRecord>of configurable capacity (RpcClient::with_buffer_size, default 1000), behind aMutexorRwLock.eprintln!rate-limited to once per 100 drops to avoid log spam. The log message names the buffer's current size and the drop count since the last warning.tokio::sync::broadcastchannel (capacity = buffer capacity) so thatwait_forwaiters are woken up on new arrivals.wait_forandcollect_events).Drop/ explicitclose(), the reader task is signalled to stop and the WebSocket is closed cleanly.Notes
The drop-warning behaviour is opinionated but not configurable in v0.1; it can be promoted to a builder option later if users need silent mode.
References