| 1 |
# AsynQueue: |
|---|
| 2 |
# Asynchronous task queueing based on the Twisted framework, with task |
|---|
| 3 |
# prioritization and a powerful worker/manager interface. |
|---|
| 4 |
# |
|---|
| 5 |
# Copyright (C) 2006-2007 by Edwin A. Suominen, http://www.eepatents.com |
|---|
| 6 |
# |
|---|
| 7 |
# This program is free software; you can redistribute it and/or modify it under |
|---|
| 8 |
# the terms of the GNU General Public License as published by the Free Software |
|---|
| 9 |
# Foundation; either version 2 of the License, or (at your option) any later |
|---|
| 10 |
# version. |
|---|
| 11 |
# |
|---|
| 12 |
# This program is distributed in the hope that it will be useful, but WITHOUT |
|---|
| 13 |
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS |
|---|
| 14 |
# FOR A PARTICULAR PURPOSE. See the file COPYING for more details. |
|---|
| 15 |
# |
|---|
| 16 |
# You should have received a copy of the GNU General Public License along with |
|---|
| 17 |
# this program; if not, write to the Free Software Foundation, Inc., 51 |
|---|
| 18 |
# Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA |
|---|
| 19 |
|
|---|
| 20 |
""" |
|---|
| 21 |
Custom Exceptions |
|---|
| 22 |
""" |
|---|
| 23 |
|
|---|
| 24 |
from zope.interface import Invalid |
|---|
| 25 |
|
|---|
| 26 |
|
|---|
| 27 |
class QueueRunError(Exception): |
|---|
| 28 |
""" |
|---|
| 29 |
An attempt was made to dispatch tasks when the dispatcher isn't running. |
|---|
| 30 |
""" |
|---|
| 31 |
|
|---|
| 32 |
|
|---|
| 33 |
class ImplementationError(Exception): |
|---|
| 34 |
""" |
|---|
| 35 |
There was a problem implementing the required interface. |
|---|
| 36 |
""" |
|---|
| 37 |
|
|---|
| 38 |
|
|---|
| 39 |
class InvariantError(Invalid): |
|---|
| 40 |
""" |
|---|
| 41 |
An invariant of the IWorker provider did not meet requirements. |
|---|
| 42 |
""" |
|---|
| 43 |
def __repr__(self): |
|---|
| 44 |
return "InvariantError(%r)" % self.args |
|---|