Skip to content

Conversation

@DigitalSmile
Copy link
Contributor

Basic implementation of NIO2 wrapper for file creation waiting with fixed timeout.

@DigitalSmile DigitalSmile self-assigned this Dec 13, 2025
@DigitalSmile DigitalSmile changed the title #563 Added alternative implementation with WatcherService implementation #563 Added alternative implementation with WatcherService wrapper Dec 13, 2025
@DigitalSmile DigitalSmile requested a review from eitch December 13, 2025 07:55
@DigitalSmile DigitalSmile linked an issue Dec 13, 2025 that may be closed by this pull request
*/
public class FileWatcher implements AutoCloseable {
// in ms
private static final int TIMEOUT = 100;
Copy link
Member

Choose a reason for hiding this comment

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

Why not rename TIMEOUT_MS?

Copy link
Member

Choose a reason for hiding this comment

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

And possibly pass the timeout on construction?

@taartspi
Copy link
Collaborator

code looks good. I tried the PR that is merged, removes my direct delay and uses the existing waitForFile This does not work. The testcase creates the PWM and immediately call ON. The On cannot access the file open of the period, fails access Maybe the waitForFile File.access returns OK (0) before the file is fully created. I will try this code next.

Copy link
Collaborator

@taartspi taartspi left a comment

Choose a reason for hiding this comment

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

code looks good. I tried the PR that is merged, removes my direct delay and uses the existing waitForFile This does not work. The testcase creates the PWM and immediately call ON. The On cannot access the file open of the period, fails access Maybe the waitForFile File.access returns OK (0) before the file is fully created. I will try this code next.

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.

ffm PWM channel other than 0 fail to export after reboot.

4 participants