aside.models.database module

Methods for serialization of Task and Queue.

dump_iso_dt()

[sep] -> string in ISO 8601 format, YYYY-MM-DDT[HH[:MM[:SS[.mmm[uuu]]]]][+HH:MM]. sep is used to separate the year from the time, and defaults to ‘T’. timespec specifies what components of the time to include (allowed values are ‘auto’, ‘hours’, ‘minutes’, ‘seconds’, ‘milliseconds’, and ‘microseconds’).

check_locking(func)[source]
class Database(queue_manager: QueueManager, data_dir: Optional[PathLike] = None)[source]

Bases: object

Serialize into files on disk in tree-like directories.

__init__(queue_manager: QueueManager, data_dir: Optional[PathLike] = None)[source]

Set up data directory.

observe_task(event: Event)[source]

Observe tasks collection events raised by queue manager.

Regexp string for matching events: .*/tasks/[^/]*

observe_task_metadata(event: Event)[source]

Observe task events raised by queue manager.

Regexp string for matching events: .*/tasks/[^/]*/[^/]*

observe_queue(event: Event)[source]

Observe queue collection events raised by queue manager.

Regexp string for matching events: queues/[^/]*

observe_queue_metadata(event: Event)[source]

Observe queue events raised by queue manager.

Regexp string for matching events: queues/[^/]*/[^/]*

populate_manager_from_disk(queue_manager: QueueManager)[source]

Take queue manager and fill it with queues from disk.

populate_queue_from_disk(queue: Queue) None[source]

Read queue by id from disk.