Logo Search packages:      
Sourcecode: tahoe-lafs version File versions  Download package

allmydata::monitor::IMonitor Class Reference

Inherits zope::interface::Interface.

List of all members.

Detailed Description

I manage status, progress, and cancellation for long-running operations.

Whoever initiates the operation should create a Monitor instance and pass
it into the code that implements the operation. That code should
periodically check in with the Monitor, perhaps after each major unit of
work has been completed, for two purposes.

The first is to inform the Monitor about progress that has been made, so
that external observers can be reassured that the operation is proceeding
normally. If the operation has a well-known amount of work to perform,
this notification should reflect that, so that an ETA or 'percentage
complete' value can be derived.

The second purpose is to check to see if the operation has been
cancelled. The impatient observer who no longer wants the operation to
continue will inform the Monitor; the next time the operation code checks
in, it should notice that the operation has been cancelled, and wrap
things up. The same monitor can be passed to multiple operations, all of
which may check for cancellation: this pattern may be simpler than having
the original caller keep track of subtasks and cancel them individually.

Definition at line 5 of file monitor.py.

Public Member Functions

def cancel
def finish
def get_status
def is_cancelled
def is_finished
def raise_if_cancelled
def set_status
def when_done

The documentation for this class was generated from the following file:

Generated by  Doxygen 1.6.0   Back to index