class_docstr: Server that works with ``FileTimerClient``. Clients are expected to be
  running on the same host as the process that is running this server.
  Each host in the job is expected to start its own timer server locally
  and each server instance manages timers for local workers (running on
  processes on the same host).
  
  Args:
  
      file_path: str, the path of a FIFO special file to be created.
  
      max_interval: float, max interval in seconds for each watchdog loop.
  
      daemon: bool, running the watchdog thread in daemon mode or not.
                    A daemon thread will not block a process to stop.
      log_event: Callable[[Dict[str, str]], None], an optional callback for
              logging the events in JSON format.
class_docstr_tok: ["Server","that","works","with","``","FileTimerClient","``",".","Clients","are","expected","to","be","running","on","the","same","host","as","the","process","that","is","running","this","server",".","Each","host","in","the","job","is","expected","to","start","its","own","timer","server","locally","and","each","server","instance","manages","timers","for","local","workers","(","running","on","processes","on","the","same","host",")",".","Args",":","file_path",":","str",",","the","path","of","a","FIFO","special","file","to","be","created",".","max_interval",":","float",",","max","interval","in","seconds","for","each","watchdog","loop",".","daemon",":","bool",",","running","the","watchdog","thread","in","daemon","mode","or","not",".","A","daemon","thread","will","not","block","a","process","to","stop",".","log_event",":","Callable","[","[","Dict","[","str",",","str","]","]",",","None","]",",","an","optional","callback","for","logging","the","events","in","JSON","format","."]
code: def _get_requests(
      self, fd: io.TextIOWrapper, max_interval: float
  ) -> List[FileTimerRequest]:
      start = time.time()
      requests = []
      while not self._stop_signaled or self._run_once:
          # For named pipe, readline() is blocking when at least one writer opens.
          # It returns only when flush() is called at the writer side.
          # Note that flush() is automatically called inside close().
          # After the last writer closes, readline() is not blocking.
          # It will return an empty string when it's at end-of-file.
          # Since the client side always opens the pipe, writes a message and closes
          # the pipe immediately, the readline() call below is not blocking for long.
          json_request = fd.readline()
          if len(json_request) == 0:
              if self._run_once:
                  break
              time.sleep(min(max_interval, 1))
          else:
              request = json.loads(json_request)
              pid = request["pid"]
              scope_id = request["scope_id"]
              expiration_time = request["expiration_time"]
              signal = request["signal"]
              requests.append(
                  FileTimerRequest(
                      worker_pid=pid,
                      scope_id=scope_id,
                      expiration_time=expiration_time,
                      signal=signal,
                  )
              )
          now = time.time()
          if now - start > max_interval:
              break
      return requests
  
imports: import io
  import json
  import logging
  import os
  import select
  import signal
  import sys
  import threading
  import time
  from typing import Callable, Dict, List, Optional, Set, Tuple
  from torch.distributed.elastic.timer.api import TimerClient, TimerRequest
label_desc: Use image node_id 8 for calling the FileTimerServer obj's underlying member method code with example usage: obj._get_requests(fd, max_interval) and returns: requests