Skip to content

Conversation

@itnavigate
Copy link

This PR is to add the ability to create a FIFO file that is not rolled over every hour.
This adds the output option of type = "fifofile".
Currently I have only tested that the FIFO is created, populated and not terminated every hour.
I have also added an example config to show how I am using the FIFO outputs.

I am not happy with the code replication that I have introduced, but as first PR I thought I'd submit working code, then in a later PR I can refactor the elseif concerning rawfile and fifofile to reduce this for readability and maintainability. I figured that this format of change in the code would be easier to follow rather than immediately introducing the refactoring also.

This is my first ever PR anywhere (I have submitted patches to projects previously though - just to give away my age :-/ ), so If I have got anything wrong, please be gentle, but advise so I can correct.
Also, if I have not followed best practices, or could do something to make your job as a maintainer easier, please also advise so I can rectify and learn.

Add the ability to create a FIFO file that is not rolled over every hour
@itnavigate
Copy link
Author

itnavigate commented Feb 16, 2025

I have found an error where this PR cancels other outputs. What is the correct protocol for asking you to wait until I've made corrections before you review? Do I close this PR?

@gabeschine
Copy link
Collaborator

I have found an error where this PR cancels other outputs. What is the correct protocol for asking you to wait until I've made corrections before you review? Do I close this PR?

No problem. Just let me know when it's ready for review.

Add select call to check if the FIFO is being read.
Add fdata->fd as integer for the open() file descriptor.
@itnavigate
Copy link
Author

OK. The FIFO file write was blocking when there was no reader. I have resolved that by opening the FIFO in NONBLOCK mode, and then checking for a reader before writing.

@gabeschine gabeschine self-requested a review February 19, 2025 14:16
@gabeschine gabeschine self-assigned this Feb 19, 2025
@itnavigate
Copy link
Author

Hmm.. stand by on checking - Found some issues. Sorry.

@gabeschine
Copy link
Collaborator

How's this coming along?

I landed a PR that may create a bit of merging work for you. Just a heads up.

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