set_operator_timeoutset_operator_timeoutSetOperatorTimeoutSetOperatorTimeoutset_operator_timeout (算子名称)

名称

set_operator_timeoutset_operator_timeoutSetOperatorTimeoutSetOperatorTimeoutset_operator_timeout — Set a timeout for an operator.

参数签名

set_operator_timeout( : : OperatorName, Timeout, Mode : )

Herror set_operator_timeout(const char* OperatorName, double Timeout, const char* Mode)

Herror T_set_operator_timeout(const Htuple OperatorName, const Htuple Timeout, const Htuple Mode)

void SetOperatorTimeout(const HTuple& OperatorName, const HTuple& Timeout, const HTuple& Mode)

static void HOperatorSet.SetOperatorTimeout(HTuple operatorName, HTuple timeout, HTuple mode)

def set_operator_timeout(operator_name: MaybeSequence[str], timeout: MaybeSequence[Union[int, float, str]], mode: str) -> None

描述

set_operator_timeoutset_operator_timeoutSetOperatorTimeoutSetOperatorTimeoutSetOperatorTimeoutset_operator_timeout sets a timeout for the operator OperatorNameOperatorNameOperatorNameOperatorNameoperatorNameoperator_name. TimeoutTimeoutTimeoutTimeouttimeouttimeout is given in seconds. Setting TimeoutTimeoutTimeoutTimeouttimeouttimeout to 0 or 'off'"off""off""off""off""off" clears the timeout. The timeout is set for the current thread only and is not inherited by child threads.

Multiple operator names can be passed to OperatorNameOperatorNameOperatorNameOperatorNameoperatorNameoperator_name. In this case, one can either pass a single timeout in TimeoutTimeoutTimeoutTimeouttimeouttimeout, which is then set for all operators, or one timeout per operator.

Two timeout modes are supported and selected with ModeModeModeModemodemode:

'cancel'

Cancels the execution of 该算子 after the timeout expires, raises the exception H_ERR_TIMEOUT (9400). All results computed by 该算子 are discarded.

'break'

Break the execution of 该算子 after the timeout expires. 该算子 returns normally. If possible, results computed by the operator up to the point of the timeout are returned.

注意

Note that not all operators support timeouts. If a given operator supports timeouts and which modes are supported is described in the execution information section of the reference documentation of the corresponding operator.

Also note that there is no hard guarantee about the granularity of the timeout. The granularity can depend on 该算子, its input data and the speed of the device. It is typically finer than 10 ms.

运行信息

参数表

OperatorNameOperatorNameOperatorNameOperatorNameoperatorNameoperator_name (input_control)  string(-array) HTupleMaybeSequence[str]HTupleHtuple (string) (string) (HString) (char*)

Operator for which the timeout shall be set.

TimeoutTimeoutTimeoutTimeouttimeouttimeout (input_control)  number(-array) HTupleMaybeSequence[Union[int, float, str]]HTupleHtuple (real / integer / string) (double / int / long / string) (double / Hlong / HString) (double / Hlong / char*)

Timeout in seconds.

Default: 1

Suggested values: 1, 0.1, 0.5, 'off'"off""off""off""off""off", 0

ModeModeModeModemodemode (input_control)  string HTuplestrHTupleHtuple (string) (string) (HString) (char*)

Timeout mode to be set.

Default: 'cancel' "cancel" "cancel" "cancel" "cancel" "cancel"

Suggested values: 'cancel'"cancel""cancel""cancel""cancel""cancel", 'break'"break""break""break""break""break"

结果

该算子 set_operator_timeoutset_operator_timeoutSetOperatorTimeoutSetOperatorTimeoutSetOperatorTimeoutset_operator_timeout returns the value 2 ( H_MSG_TRUE) 如果参数都是正确的。 Otherwise an exception will be raised.

可替代算子

interrupt_operatorinterrupt_operatorInterruptOperatorInterruptOperatorInterruptOperatorinterrupt_operator

参考其它

interrupt_operatorinterrupt_operatorInterruptOperatorInterruptOperatorInterruptOperatorinterrupt_operator, get_current_hthread_idget_current_hthread_idGetCurrentHthreadIdGetCurrentHthreadIdGetCurrentHthreadIdget_current_hthread_id

模块

Foundation