Commons IO
  1. Commons IO
  2. IO-345

Supply a hook method allowing Tailer actively determining stop condition

    Details

    • Type: Improvement Improvement
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 2.5
    • Component/s: None
    • Labels:
      None

      Description

      I am using the Tailer class on the server side and would like add some timeout checking to automatically stop the tailer. With the current version, if I want to avoid the usage of another thread, I can perform this check only inside the methods of the TailerListener. If no events are generated (due to the tailed file not changing), this check would never be executed.
      Therefore I suggest the addition of a protected method, something like:

      Tailer.java
      protected boolean shouldRun() {
          return this.run;
      }
      

      Instead of testing the boolean variable run, the Tailer thread would call this method.
      This would allow subclassing Tailer for adding some logic, which dynamically decides whether the tailer should continue running or not. For users not needing this feature, nothing would change.

        Activity

        Martin Kresse created issue -
        Gary Gregory made changes -
        Field Original Value New Value
        Status Open [ 1 ] Resolved [ 5 ]
        Fix Version/s 2.5 [ 12322486 ]
        Resolution Fixed [ 1 ]

          People

          • Assignee:
            Unassigned
            Reporter:
            Martin Kresse
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development