timeout

@CheckReturnValue
open fun timeout(timeout: Long, timeoutUnit: TimeUnit, handlerName: String, vararg data: Any?): T(source)

Sets the timeout on this component, invalidating the component on expiration, and running the timeout handler with the given name and its arguments.

Note: Components inside groups cannot have timeouts.

Timeout cancellation

The timeout will be canceled once a component has been deleted, including if the component was set to a single use.

Component deletion

  • If the component is a group, then all of its owned components will also be deleted.

  • If the component is inside a group, then all the group's components will also be deleted.

Timeout data

The data passed is serialized and later deserialized using their resolver.

Each passed object needs to correspond to a parameter of the function (in the declaration order, excluding non-data parameters).

For objects supported by default (see ParameterResolver) and by other TimeoutParameterResolvers, you must annotate your parameter with @TimeoutData.

For serializable objects, you can instead use @SerializableTimeoutData.

Parameters

timeout

The value of the timeout

timeoutUnit

The unit of the timeout

handlerName

The name of the handler to run when the component expires, defined by either @ComponentTimeoutHandler or @GroupTimeoutHandler depending on the type

data

The data to pass to the timeout handler

See also

@ComponentTimeoutHandler

@GroupTimeoutHandler


@CheckReturnValue
open fun timeout(timeout: Duration, handlerName: String, vararg data: Any?): T(source)
abstract fun timeout(timeout: Duration, handlerName: String, vararg data: Any?): T(source)

Sets the timeout on this component, invalidating the component on expiration, and running the timeout handler with the given name and its arguments.

Note: Components inside groups cannot have timeouts.

Timeout cancellation

The timeout will be canceled once a component has been deleted, including if the component was set to a single use.

Component deletion

  • If the component is a group, then all of its owned components will also be deleted.

  • If the component is inside a group, then all the group's components will also be deleted.

Timeout data

The data passed is serialized and later deserialized using their resolver.

Each passed object needs to correspond to a parameter of the function (in the declaration order, excluding non-data parameters).

For objects supported by default (see ParameterResolver) and by other TimeoutParameterResolvers, you must annotate your parameter with @TimeoutData.

For serializable objects, you can instead use @SerializableTimeoutData.

Parameters

timeout

The duration of the timeout

handlerName

The name of the handler to run when the component expires, defined by either @ComponentTimeoutHandler or @GroupTimeoutHandler depending on the type

data

The data to pass to the timeout handler

See also

@ComponentTimeoutHandler

@GroupTimeoutHandler