interaction.slave.action¶
ConnectionRefuse¶
- class ding.interaction.slave.action.ConnectionRefuse(data: Optional[Mapping[str, Any]] = None)[source]¶
- Overview:
Exception represents the refuse to connection to slave from master, can be used in method _before_connection.
- Example:
Without data
>>> raise ConnectionRefuse
With refuse data
>>> raise ConnectionRefuse({'data': 233})
DisconnectionRefuse¶
- class ding.interaction.slave.action.DisconnectionRefuse(data: Optional[Mapping[str, Any]] = None)[source]¶
- Overview:
Exception represents the refuse to disconnection to slave from master, can be used in method _before_disconnection.
- Example:
Without data
>>> raise DisconnectionRefuse
With refuse data
>>> raise DisconnectionRefuse({'data': 233})
TaskRefuse¶
TaskFail¶
- class ding.interaction.slave.action.TaskFail(result: Optional[Mapping[str, Any]] = None, message: Optional[str] = None)[source]¶
- Overview:
Exception represents the failure of tasks, can be used in method _process_task.
- Example:
Without data
>>> raise TaskFail
With failure data
>>> raise TaskFail({'data': 233})
With both data and message
>>> raise TaskFail({'data': 233}, 'this is message')
- __init__(result: Optional[Mapping[str, Any]] = None, message: Optional[str] = None)[source]¶
- Overview:
Constructor of TaskFail
- Arguments:
result (
Optional[Mapping[str, Any]]
): Result of task failuremessage (
Optional[str]
): Message of task failure
- property result: Mapping[str, Any]¶
- Overview:
Get the result of task failure.
- Returns:
Result of task failure.