deluge.core.alertmanager

The AlertManager handles all the libtorrent alerts.

This should typically only be used by the Core. Plugins should utilize the :mod:EventManager for similar functionality.

class deluge.core.alertmanager.AlertManager

Bases: deluge.component.Component

deregister_handler(handler)

De-registers the :param:handler function from all alert types.

Parameter:handler – func, the handler function to deregister
handle_alerts(wait=False)

Pops all libtorrent alerts in the session queue and handles them appropriately.

Parameter:wait – bool, if True then the handler functions will be run right away and waited to return before processing the next alert
register_handler(alert_type, handler)

Registers a function that will be called when ‘alert_type’ is pop’d in handle_alerts. The handler function should look like: handler(alert) Where ‘alert’ is the actual alert object from libtorrent.

Parameters:
  • alert_type – str, this is string representation of the alert name
  • handler – func(alert), the function to be called when the alert is raised
update()

Previous topic

deluge.rencode

Next topic

deluge.core.authmanager

This Page