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})
__init__(data: Optional[Mapping[str, Any]] = None)[source]
Overview:

Constructor of ConnectionRefuse

Arguments:
  • data (Optional[Mapping[str, Any]]): Key-value-formed refuse data

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})
__init__(data: Optional[Mapping[str, Any]] = None)[source]
Overview:

Constructor of DisconnectionRefuse

Arguments:
  • data (Optional[Mapping[str, Any]]): Key-value-formed refuse data

TaskRefuse

class ding.interaction.slave.action.TaskRefuse(data: Optional[Mapping[str, Any]] = None)[source]
Overview:

Exception represents the refuse to tasks, can be used in method _before_task.

Example:
  • Without data

>>> raise TaskRefuse
  • With refuse data

>>> raise TaskRefuse({'data': 233})
__init__(data: Optional[Mapping[str, Any]] = None)[source]
Overview:

Constructor of TaskRefuse

Arguments:
  • data (Optional[Mapping[str, Any]]): Key-value-formed refuse data

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 failure

  • message (Optional[str]): Message of task failure

property result: Mapping[str, Any]
Overview:

Get the result of task failure.

Returns:

Result of task failure.