Method Filesystem.Monitor.basic()->check()
- Method
check
intcheck(int|voidmax_wait,int|voidmax_cnt,mapping(string:int)|voidret_stats)- Description
Check for changes.
- Parameter
max_wait Maximum time in seconds to wait for changes.
-1for infinite wait.- Parameter
max_cnt Maximum number of paths to check in this call.
0(zero) for unlimited.- Parameter
ret_stats Optional mapping that will be filled with statistics (see below).
A suitable subset of the monitored files will be checked for changes.
- Returns
The function returns when either a change has been detected or when
max_waithas expired. The returned value indicates the number of seconds until the next call of check().If
ret_statshas been provided, it will be filled with the following entries:"num_monitors":intThe total number of active monitors when the scan completed.
"scanned_monitors":intThe number of monitors that were scanned for updates during the call.
"updated_monitors":intThe number of monitors that were updated during the call.
"idle_time":intThe number of seconds that the call slept.
- Note
Any callbacks will be called from the same thread as the one calling check().
- See also