import { FileIPC } from "https://deno.land/x/pup@1.0.0-rc.2/lib/common/ipc.ts";
extractMessages is a private helper function that reads from the IPC file, validates the messages and returns them as an array of IpcValidatedMessage. It also handles the removal of the file after reading and validates the data based on the staleMessageLimitMs.
This function is called every time a 'modify' event is detected by the file watcher started in startWatching method.
Note: This function should only be used internally by the FileIPC class and is not meant to be exposed to external consumers.
Returns
Promise<IpcValidatedMessage[]>