import { FileIPC } from "https://deno.land/x/pup@1.0.0-rc.9/lib/common/ipc.ts";
Properties
Methods
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.
startWatching method initiates a file watcher on the filePath. When a file modification event occurs, it will debounce the call to extractMessages to ensure it doesn't get called more than once in a short amount of time (as specified by debounceTimeMs). The received messages from the extractMessages call are then added to the messageQueue to be consumed by the receiveData generator.
Close the file-based IPC and remove the IPC file.
Send data using the file-based IPC.
Will append to file in this.filePath
if it exists, otherwise create a new one