Create a new watcher instance with the given options
Optional
options: WatcherOptionsThe watcher options
Optional
logger: LoggerInstanceThe logger instance
Get the component identifier
Get the error stack
Get the name of the watcher
Get the status of the watcher
Add a listener for the error
event, emitted when the component detects an error.
Add a listener for the status event, emitted when the component status changes.
status
event
Status event listener
Add a listener for the add event, emitted when a file is added.
add
event
Add event listener
A resource is extended component that represent the access to an external/internal resource, besides the error handling and identity, it has a start, stop and close methods to manage the resource lifecycle. It also has a checks property to define the checks that will be performed over the resource to achieve the resulted status. The most typical example of a resource are the Provider that allow to access to external databases, message brokers, etc.