dragonfly.implementations.dungbeetle module

Some template vars

Members: DungBeetle Functions: Classes:

Summary

class dragonfly.implementations.dungbeetle.DungBeetle(root_dirs=[], max_age={'hours': 2}, ignore_dirs=[], warning_interval=12, **kwargs)

Bases: dragonfly.implementations.dungbeetle.DungBeetle

A scheduler endpoint for removing stale directories.

Keyword Arguments:
 
  • root_dirs (list of str) – list of strings naming paths to monitor, these dirs are not removed
  • max_age (dict) – min age for a directory to be removed if empty, is a dict of kwargs to datetime.timedelta.__init__
  • ignore_dirs (list of str) – list of string names of paths to ignore, each must be a full path (starting with the corresponding value from root_dirs)
  • warning_interval (int) – the number of cycles that a warning will be sent when a directory has not been removed for a long time
  • name (str) – unique identifier across all dripline services (used to determine routing key)
  • calibration (str||dict) – string use to process raw get result (with .format(raw)) or a dict to use for the same purpose where raw must be a key
  • get_on_set (bool) – flag to toggle running ‘on_get’ after each ‘on_set’
  • schedule_interval (float) – time in seconds between scheduled events

root_dirs (list of str): list of strings naming paths to monitor, these dirs are not removed max_age (dict): min age for a directory to be removed if empty, is a dict of kwargs to datetime.timedelta.__init__ ignore_dirs (list of str): list of string names of paths to ignore, each must be a full path (starting with the corresponding value from root_dirs) warning_interval (int): the number of cycles that a warning will be sent when a directory has not been removed for a long time

clean_dir(processed_dirs_per_cycle, new_dirs)
del_dir(path, min_creation_time, processed_dirs_per_cycle, new_dirs)
handle_request(channel, method, properties, request)
is_locked
lock(lockout_key=None, *args, **kwargs)
lockout_key
on_cmd(*args, **kwargs)

WARNING! if you override this method, you must ensure you deal with lockout properly

on_config(attribute, value=None)

configure a property again

WARNING! if you override this method, you must ensure you deal with lockout properly

ping(*args, **kwargs)

ignore all details and respond with an empty message

schedule_interval
schedule_status
scheduled_action()
set_condition(*args, **kwargs)

To actually do something inside a class, the set_condition should be implemented in the class itself.

single_schedule(delay)
unlock(*args, **kwargs)

End of modules condition

Data:

End of data condition