feat: Add event-based automation triggers (#2537)
This commit is contained in:
committed by
dermotduffy
parent
b701366762
commit
a31816c168
@@ -0,0 +1,16 @@
|
||||
// Returned by `addListener`; invoke it to stop listening.
|
||||
export type UnlistenCallback = () => void;
|
||||
|
||||
// A source of health information: the current failures (of some domain-specific
|
||||
// shape `F`) and a way to observe changes to them.
|
||||
interface HealthInterface<F> {
|
||||
getFailures(): F[];
|
||||
addListener(listener: () => void): UnlistenCallback;
|
||||
}
|
||||
|
||||
// Health that also supports a user-driven retry of whatever is currently
|
||||
// failing. Separate from HealthInterface because observation and recovery are
|
||||
// distinct capabilities: a read-only health source has nothing to retry.
|
||||
export interface RecoverableHealthInterface<F> extends HealthInterface<F> {
|
||||
retry(): void;
|
||||
}
|
||||
Reference in New Issue
Block a user