Skip to content

event,request: queue pending events per device - #33

Merged
ids1024 merged 1 commit into
ids1024:masterfrom
hojjatabdollahi:hojjat/device-queue
Jul 30, 2026
Merged

event,request: queue pending events per device#33
ids1024 merged 1 commit into
ids1024:masterfrom
hojjatabdollahi:hojjat/device-queue

Conversation

@hojjatabdollahi

@hojjatabdollahi hojjatabdollahi commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

Based on discussion in Smithay/smithay#2115

Comment thread src/request.rs Outdated
pub struct EisRequestConverter {
requests: VecDeque<EisRequest>,
pending_requests: VecDeque<EisRequest>,
pending_requests: HashMap<Device, VecDeque<EisRequest>>, // keyed by the device

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should probably make sure to remove entries when a device is removed.

Maybe it would be better to have a Mutex<VecDeque<EisRequest>> in DeviceInner. A bit annoying to need to lock a mutex when we only use it in the thread owning the EisRequestConverter but that might be a bit better.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can do that.
That would definitely be annoying though!

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Moved it inside the device, with a mutex.

Comment thread src/request.rs Outdated
Comment on lines +296 to +299
// Should be unreachable
// TODO: how do we handle this?
log::warn!("reis: timestamped request with no device; delivering unframed");
self.requests.push_back(request);

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since it should be statically impossible, a panic is appropriate.

@hojjatabdollahi

hojjatabdollahi commented Jul 30, 2026

Copy link
Copy Markdown
Contributor Author

Alright, it's now explicitly clearing the queue.

@ids1024
ids1024 merged commit a09eff7 into ids1024:master Jul 30, 2026
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