import { Status } from "https://deno.land/x/pup@1.0.0-rc.8/lib/core/status.ts";
Represents the status of the application and provides methods to write the status to disk or store.
Methods
applicationState(processes: Process[]): ApplicationState
Generates the current application state based on the statuses of the processes.
cleanup()
Should make any changes necessary when the application exits, like unsetting last_application_state in the kv store.
purge(keepHours: number): Promise<number>
Deletes the application_state logs older than the given number of hours.
writeToStore(applicationState: ApplicationState)
Writes the application status to the KV store with a timestamp as part of the key.
Key ["last_application_state"] is written every iteration. Key ["application_state", ] is written at most once per 20 seconds.